DATAKIT API  V2025.4
Modes for reading drawing files (SLDDRW extension)

Why two modes ?

When SOLIDWORKS saves a drawing file, it does not only save the data you can edit and work with inside the software, it also saves a graphic version of what is displayed.
So there is inside a SOLIDWORKS file, two types of data. The original one that we will call "semantic data", and the graphic one generated from it, that we will call "graphic data".
Even, if there is obviously some kind of connection between them, it is better to consider them independent when saved into a file.

How can we see what each type of data look like ?

To see the "semantic data", the best way is to open your file in SOLIDWORKS software.
To see the "graphic data", the best way is to open your file in eDrawings software. eDrawings is a viewer from the same company, often installed with SOLIDWORKS. eDrawings can open SOLIDWORKS files, but it can only interpret the "graphic data".

What are the differences ?

Semantic data Graphic data
Can SLDDRW file be used alone without referenced 3D files (SLDPRT, SLDASM) ? No Yes
Need to integrate Dtk_Body ? Yes Yes (only if there are shaded views)
Need to integrate Dtk_mesh ? No Yes (only if there are shaded views)
Has semantic PMI ? Yes No. Are converted to independent lines and texts.
Is always up-to-date Yes No
Do views have names ? Yes No

Library integration

When using librairies, to change the mode you are using, please call function:

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

By default, the file is read with graphic data.
If you want to read semantic data, you will need to add the following code:

DTK_FALSE
#define DTK_FALSE
Definition: define.h:730
Dtk_bool
char Dtk_bool
Definition: define.h:727
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 ...