DXF FILE STRUCTURE
ASCII versions of DXF can be read with a text-editor. The basic organization of a DXF file is as follows:
- HEADER section – General information about the drawing. Each parameter has a variable name and an associated value.
- CLASSES section – Holds the information for application-defined classes whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. Generally does not provide sufficient information to allow interoperability with other programs.
- TABLES section – This section contains definitions of named items.
- Application ID (APPID) table
- Block Record (BLOCK_RECORD) table
- Dimension Style (DIMSTYPE) table
- Layer (LAYER) table
- Linetype (LTYPE) table
- Text style (STYLE) table
- User Coordinate System (UCS) table
- View (VIEW) table
- Viewport configuration (VPORT) table
- BLOCKS section – This section contains Block Definition entities describing the entities comprising each Block in the drawing.
- ENTITIES section – This section contains the drawing entities, including any Block References.
- OBJECTS section – Contains the data that apply to nongraphical objects, used by AutoLISP and ObjectARX applications.
- THUMBNAILIMAGE section – Contains the preview image for the DXF file.
- END OF FILE
Today i made point entity in Draftsight and in Librecad and compared both files.
The differences are :
In the header section of both files, common header variables but different values are :
$DIMASZ, $PLIMMIN, $PLIMMAX, $DIMEXE, $DIMGAP, $INSUNITS, $DIMEXO.
Those variables that are defined in header section of DRAFTSIGHT but in Librecad they are in DIMSTYLE section of TABLE with different values:
$ DIMSCALE, $DIMASZ, $DIMDLI, $ DIMCEN, $ DIMTIH, $DIMASO, $DIMALTD, $DIMALTF, $DIMLFAC, $DIMSTYLE, $ DIMDEC, $DIMALTU, $DIMTXSTY, $DIMATFIT and $DIMLWD.
According to File structure, these variables should be defined in header section because it containing general information about drawing.
Now, those variables that are present in header section of draftsight but absent in Librecad’s header section :
$TEXTSIZE, $TEXTSTYLE, $CLAYER, $CELTYPE, $CECOLOR, $CELTSSCALE, $ATTMODE, $LTSCALE, $FILLMODE, $LUPREC, $MENU, $UCSORG, $PUCSORG, $WORLDVIEW, $SHADEEDGE, $MAXACTVP, $PINSBASE, $FINGERPRINTGUIDE and $VERSIONGUID.
The main point is that Librecad broke DXF’s file structure — It is not adding CLASSES section of DXF.
But the draftsight follows it.
Next is TABLE section
In both files, group codes having different values, like group codes of
10, 20, 30 (lower- left corner)
11, 21 (upper right corner)
12, 22 (view center point)
14, 24 (Snap spacing X & Y)
15, 25 (grid spacing X & Y)
40 ( view height)
72 (circle zoom percent)
71 (view mode)
17, 27 (view target point – WCS)
75 (snap on/off)
76 (grid on/off)
In Libecad, LTYPE secction defined separately for various linetypes like dash, small dash, dash dot , center, border and so on.
But in Draftsight, it is defined for only continuous line type.
One group code (GC)but with different values in both files
370 // lineweight enum value
There is one GC that was missing in draftsight
290 // plotting flag
One group code (GC)but with different values in both files.
41 // width factor
42 // last height used
3 // primary font file name
Rest part of TABLE section are same
4. Entity section is also same
5. OBJECT section is totally different.