DATAKIT API  V2025.1
Modes for readings drawing files (SLDDRW extension)

Introduction

From version 2024.3, we propose two modes for reading drawing files. One mode read the semantic data, and the other one the graphic data.

What those modes correspond to inside SolidWorks software

When opening a .SLDDRW file inside SolidWorks with "File > Open...", we have access to the following window.

Opening a SLDDRW file inside SolidWorks 2024

SolidWorks allows us to choose a mode for opening the file with the following options : "Detailing", "Lightweight", "Resolved". "Resolved" is the default mode when opening a file into SolidWorks.
Our semantic mode correspond to "Resolved" and the graphic one to "Detailing".

Also, the SolidWorks eDrawings software always open files in "Detailing" mode.

What are the differences between the two modes

The "Detailing" mode is made for opening files faster for visualization purposes. This is why in it, SolidWorks stores entities that can be shown as fast as possible. It stores almost only curves and texts.

The mode you want to activate when reading a drawing files mainly depends on what you want to do with the data. Graphic mode is limited to visualization, while with semantic mode, you will be able to get complex entities that you can fully integrate into your application.

Here is an example of a dimension in the two modes.

A dimension inside SolidWorks
A dimension inside SolidWorks
The dimension in semantic mode
The dimension in semantic mode
The dimension in graphic mode
The dimension in graphic mode

In semantic mode, you have a Dtk_Dimension with a Dtk_Leader and several Dtk_Text.
In graphic mode, the dimension will be split into "graphic" entities. The leader will be a polyline, and the text of the dimension will be put inside a Dtk_Symbol that only contains a Dtk_CompositeText.

How to choose the mode to use

By default, the file is read in graphic mode.

When using librairies, use function

static void SwReader::SetConfigReadDrawingsWithGraphicRepresentation( const Dtk_bool readWithGraphicRepresentation );

If you want to enable semantic mode, you will need to add the code

DTK_FALSE
#define DTK_FALSE
Definition: define.h:728
Dtk_bool
char Dtk_bool
Definition: define.h:725
SwReader::SetConfigReadDrawingsWithGraphicRepresentation
static void SetConfigReadDrawingsWithGraphicRepresentation(const Dtk_bool readWithGraphicRepresentation)
When set to true, we read the graphic representation in .SLDDRW files. If false, we use the semantic ...