This page covers the three sections that sit between HEADER and ENTITIES: CLASSES, which declares application-defined object types; TABLES, the symbol tables of named settings; and BLOCKS, the block definitions. It follows Autodesk’s AutoCAD 2014 DXF Reference, chapters 3 to 5. “APP” marks codes that appear only in AutoLISP and ObjectARX entity lists, never in files.
- CLASSES section and default classes
- TABLES section: common codes, APPID, BLOCK_RECORD, DIMSTYLE, LAYER, LTYPE, STYLE, UCS, VIEW, VPORT
- BLOCKS section: BLOCK, ENDBLK
CLASSES section
Each class record describes an application-defined class whose instances appear in BLOCKS, ENTITIES or OBJECTS. Every field is required, and a class definition is assumed to be fixed in the class hierarchy.
| Code | Meaning |
|---|---|
| 0 | CLASS, starting the record |
| 1 | Class DXF record name; always unique |
| 2 | C++ class name, binding the class to the software that defines its behaviour; always unique |
| 3 | Application name, shown in an alert when the class is not loaded |
| 90 | Proxy capability flags (below) |
| 91 | Instance count for a custom class |
| 280 | Was-a-proxy flag: 1 if the class was not loaded when the file was written, otherwise 0 |
| 281 | Is-an-entity flag: 1 if the class derives from AcDbEntity and may appear in BLOCKS or ENTITIES; 0 means instances appear only in OBJECTS |
Proxy capability flags (code 90)
| Value | Meaning |
|---|---|
| 0 | No operations allowed |
| 1 (0x1) | Erase allowed |
| 2 (0x2) | Transform allowed |
| 4 (0x4) | Colour change allowed |
| 8 (0x8) | Layer change allowed |
| 16 (0x10) | Linetype change allowed |
| 32 (0x20) | Linetype scale change allowed |
| 64 (0x40) | Visibility change allowed |
| 128 (0x80) | Cloning allowed |
| 256 (0x100) | Lineweight change allowed |
| 512 (0x200) | Plot style name change allowed |
| 895 (0x37F) | All operations except cloning |
| 1023 (0x3FF) | All operations |
| 1024 (0x400) | Disables the proxy warning dialogue |
| 32768 (0x8000) | R13 format proxy |
0
SECTION
2
CLASSES
0
CLASS
1
<class dxf record>
2
<class name>
3
<app name>
90
<flag>
280
<flag>
281
<flag>
0
ENDSEC
Default classes
Classes AutoCAD registers. A file may hold others, depending on the applications in use. Read from the 2014 reference and checked against the 2012 edition, whose table extracts in a clearer order; the two agree.
| Record name (1) | C++ class (2) | 90 | 280 | 281 |
|---|---|---|---|---|
ACDBDICTIONARYWDFLT | AcDbDictionaryWithDefault | 0 | 0 | 0 |
ACDBPLACEHOLDER | AcDbPlaceHolder | 0 | 0 | 0 |
ARCALIGNEDTEXT | AcDbArcAlignedText | 0 | 0 | 1 |
DICTIONARYVAR | AcDbDictionaryVar | 0 | 0 | 0 |
HATCH | AcDbHatch | 0 | 0 | 1 |
IDBUFFER | AcDbIdBuffer | 0 | 0 | 0 |
IMAGE | AcDbRasterImage | 127 | 0 | 1 |
IMAGEDEF | AcDbRasterImageDef | 0 | 0 | 0 |
IMAGEDEF_REACTOR | AcDbRasterImageDefReactor | 1 | 0 | 0 |
LAYER_INDEX | AcDbLayerIndex | 0 | 0 | 0 |
LAYOUT | AcDbLayout | 0 | 0 | 0 |
LWPOLYLINE | AcDbPolyline | 0 | 0 | 1 |
OBJECT_PTR | CAseDLPNTableRecord | 1 | 0 | 0 |
OLE2FRAME | AcDbOle2Frame | 0 | 0 | 1 |
PLOTSETTINGS | AcDbPlotSettings | 0 | 0 | 0 |
RASTERVARIABLES | AcDbRasterVariables | 0 | 0 | 0 |
RTEXT | RText | 0 | 0 | 1 |
SORTENTSTABLE | AcDbSortentsTable | 0 | 0 | 0 |
SPATIAL_INDEX | AcDbSpatialIndex | 0 | 0 | 0 |
SPATIAL_FILTER | AcDbSpatialFilter | 0 | 0 | 0 |
WIPEOUT | AcDbWipeout | 127 | 0 | 1 |
WIPEOUTVARIABLES | AcDbWipeoutVariables | 0 | 0 | 0 |
TABLES section
The section holds the symbol tables APPID, BLOCK_RECORD, DIMSTYLE, LAYER, LTYPE,
STYLE, UCS, VIEW and VPORT. Their order may change, but LTYPE always comes before
LAYER. Each table is 0 TABLE, 2 the table name in upper
case, its handle, the AcDbSymbolTable subclass marker and a 70 group
giving the maximum number of entries; then the entries; then
0 ENDTAB.
Deleted entries are not written, so fewer entries may follow than the 70 group says. The count is meant only for sizing an array; do not use it to drive reading. Each entry is a 0 group with the entry type (the same as the table name), a 2 group with the entry’s name, a 70 group of flags and the entry’s other groups. Both tables and entries are database objects with a handle after their 2 groups. DIMSTYLE is the one exception: its handle is group 105, because it used group 5 for something else in earlier releases.
Codes common to all tables
| Code | Meaning |
|---|---|
| −1 | APP: entity name, changing each time a drawing is opened |
| 0 | TABLE |
| 2 | Table name |
| 5 | Handle |
| 102 | {ACAD_XDICTIONARY: start of an extension dictionary group (optional) |
| 360 | Hard-owner handle of the extension dictionary (optional) |
| 102 | }, end of group (optional) |
| 330 | Soft-pointer handle of the owner object |
| 100 | Subclass marker AcDbSymbolTable |
| 70 | Maximum number of entries in the table |
Codes common to all table entries
| Code | Meaning |
|---|---|
| −1 | APP: entity name, changing each time a drawing is opened |
| 0 | Entry type (the table name) |
| 5 | Handle (every table except DIMSTYLE) |
| 105 | Handle (DIMSTYLE only) |
| 102 | {application_name: start of an application-defined group (optional); its codes and values are defined by the application, and a 102 } ends it |
| 102 | {ACAD_REACTORS: start of the persistent reactors group, present only if reactors are attached (optional) |
| 330 | Soft-pointer handle of the owner dictionary, inside that group (optional) |
| 102 | }, end of group (optional) |
| 102 | {ACAD_XDICTIONARY: start of an extension dictionary group (optional) |
| 360 | Hard-owner handle of the extension dictionary (optional) |
| 102 | }, end of group (optional) |
| 330 | Soft-pointer handle of the owner object |
| 100 | Subclass marker AcDbSymbolTableRecord |
Standard flags (code 70)
Every table entry’s 70 group uses these bits, plus the table’s own bits listed in its section:
| Bit | Meaning |
|---|---|
| 16 | The entry is externally dependent on an xref |
| 32 | With bit 16: the xref has been resolved |
| 64 | The entry was referenced by at least one entity when the drawing was last edited. Only for AutoCAD’s commands: readers may ignore it and writers need not set it |
APPID
Registered application names, used by extended data.
| Code | Meaning |
|---|---|
| 100 | AcDbRegAppTableRecord |
| 2 | Application name supplied by the user or application |
| 70 | Standard flags (16, 32, 64) |
BLOCK_RECORD
| Code | Meaning |
|---|---|
| 100 | AcDbBlockTableRecord |
| 2 | Block name |
| 340 | Hard-pointer handle of the associated LAYOUT object |
| 70 | Block insertion units |
| 280 | Block explodability |
| 281 | Block scalability |
| 310 | DXF: binary data of the bitmap preview (optional) |
| 1001 | Xdata application name ACAD (optional) |
| 1000 | Xdata string DesignCenter Data (optional) |
| 1002 | {, start of xdata group (optional) |
| 1070 | DesignCenter version number |
| 1070 | Insert units: 0 unitless, 1 inches, 2 feet, 3 miles, 4 millimetres, 5 centimetres, 6 metres, 7 kilometres, 8 microinches, 9 mils, 10 yards, 11 ångströms, 12 nanometres, 13 microns, 14 decimetres, 15 decametres, 16 hectometres, 17 gigametres, 18 astronomical units, 19 light years, 20 parsecs |
| 1002 | }, end of xdata group |
DIMSTYLE
Each code holds the dimension variable of the same name; see the header variables for their values.
| Code | Meaning |
|---|---|
| 100 | AcDbDimStyleTableRecord |
| 2 | Dimension style name |
| 70 | Standard flags (16, 32, 64) |
| 3 | DIMPOST |
| 4 | DIMAPOST |
| 5 | DIMBLK (obsolete, now an object ID) |
| 6 | DIMBLK1 (obsolete, now an object ID) |
| 7 | DIMBLK2 (obsolete, now an object ID) |
| 40 | DIMSCALE |
| 41 | DIMASZ |
| 42 | DIMEXO |
| 43 | DIMDLI |
| 44 | DIMEXE |
| 45 | DIMRND |
| 46 | DIMDLE |
| 47 | DIMTP |
| 48 | DIMTM |
| 140 | DIMTXT |
| 141 | DIMCEN |
| 142 | DIMTSZ |
| 143 | DIMALTF |
| 144 | DIMLFAC |
| 145 | DIMTVP |
| 146 | DIMTFAC |
| 147 | DIMGAP |
| 148 | DIMALTRND |
| 71 | DIMTOL |
| 72 | DIMLIM |
| 73 | DIMTIH |
| 74 | DIMTOH |
| 75 | DIMSE1 |
| 76 | DIMSE2 |
| 77 | DIMTAD |
| 78 | DIMZIN |
| 79 | DIMAZIN |
| 170 | DIMALT |
| 171 | DIMALTD |
| 172 | DIMTOFL |
| 173 | DIMSAH |
| 174 | DIMTIX |
| 175 | DIMSOXD |
| 176 | DIMCLRD |
| 177 | DIMCLRE |
| 178 | DIMCLRT |
| 179 | DIMADEC |
| 270 | DIMUNIT (obsolete; now DIMLUNIT and DIMFRAC) |
| 271 | DIMDEC |
| 272 | DIMTDEC |
| 273 | DIMALTU |
| 274 | DIMALTTD |
| 275 | DIMAUNIT |
| 276 | DIMFRAC |
| 277 | DIMLUNIT |
| 278 | DIMDSEP |
| 279 | DIMTMOVE |
| 280 | DIMJUST |
| 281 | DIMSD1 |
| 282 | DIMSD2 |
| 283 | DIMTOLJ |
| 284 | DIMTZIN |
| 285 | DIMALTZ |
| 286 | DIMALTTZ |
| 287 | DIMFIT (obsolete; now DIMATFIT and DIMTMOVE) |
| 288 | DIMUPT |
| 289 | DIMATFIT |
| 340 | DIMTXSTY: handle of the STYLE entry |
| 341 | DIMLDRBLK: handle of the block |
| 342 | DIMBLK: handle of the block |
| 343 | DIMBLK1: handle of the block |
| 344 | DIMBLK2: handle of the block |
| 371 | DIMLWD (lineweight value) |
| 372 | DIMLWE (lineweight value) |
DIMFRAC (276) has no header variable in the reference’s list, so its values are not given there.
LAYER
| Code | Meaning |
|---|---|
| 100 | AcDbLayerTableRecord |
| 2 | Layer name |
| 70 | Flags: 1 frozen (otherwise thawed); 2 frozen by default in new viewports; 4 locked; and the standard 16, 32, 64 |
| 62 | Colour number; negative means the layer is off |
| 6 | Linetype name |
| 290 | Plotting flag; 0 means do not plot this layer |
| 370 | Lineweight value |
| 390 | Hard-pointer handle of the PlotStyleName object |
| 347 | Hard-pointer handle of the Material object |
Xref-dependent layers are written by SAVEAS with the linetype name
CONTINUOUS.
LTYPE
| Code | Meaning |
|---|---|
| 100 | AcDbLinetypeTableRecord |
| 2 | Linetype name |
| 70 | Standard flags (16, 32, 64) |
| 3 | Descriptive text |
| 72 | Alignment code, always 65 (ASCII A) |
| 73 | Number of linetype elements |
| 40 | Total pattern length |
| 49 | Dash, dot or space length, one per element |
| 74 | Complex element type, one per element; default 0 (no embedded shape or text). Bits: 1 code 50 is an absolute rotation (otherwise relative); 2 the embedded element is a text string; 4 it is a shape |
| 75 | Shape number, one per element, when 74 says shape; 0 when 74 says text; left out when 74 is 0 |
| 340 | Pointer to the STYLE entry, one per element when 74 is greater than 0 |
| 46 | S: scale value (optional; may repeat) |
| 50 | R (relative) or A (absolute) rotation in radians of the embedded shape or text, one per element that has one |
| 44 | X offset (optional; may repeat) |
| 45 | Y offset (optional; may repeat) |
| 9 | Text string, one per element whose 74 is 2 |
Codes 74, 75, 340, 46, 50, 44, 45 and 9 are not returned by AutoLISP’s
tblsearch or tblnext; tblobjname gives
them. Note that rotation here is in radians, unlike angles elsewhere in DXF.
STYLE
| Code | Meaning |
|---|---|
| 100 | AcDbTextStyleTableRecord |
| 2 | Style name |
| 70 | Flags: 1 the entry describes a shape; 4 vertical text; and the standard 16, 32, 64 |
| 40 | Fixed text height; 0 if not fixed |
| 41 | Width factor |
| 50 | Oblique angle |
| 71 | Text generation flags: 2 backwards (mirrored in X); 4 upside down (mirrored in Y) |
| 42 | Last height used |
| 3 | Primary font file name |
| 4 | Big font file name; empty if none |
| 1071 | A 32-bit value holding a TrueType font’s pitch and family, character set, and italic and bold flags |
A STYLE entry also records a shape file loaded with LOAD. Then bit 1 of the 70 group is set and only the 3 group (the shape file name) means anything, though the other groups are still written.
UCS
| Code | Meaning |
|---|---|
| 100 | AcDbUCSTableRecord |
| 2 | UCS name |
| 70 | Standard flags (16, 32, 64) |
| 10, 20, 30 | Origin (WCS) |
| 11, 21, 31 | X axis direction (WCS) |
| 12, 22, 32 | Y axis direction (WCS) |
| 79 | Always 0 |
| 146 | Elevation |
| 346 | Handle of the base UCS if this one is orthographic. Absent if 79 is 0; if absent while 79 is nonzero, the base is WORLD |
| 71 | Orthographic type (optional; always paired with 13, 23, 33): 1 Top, 2 Bottom, 3 Front, 4 Back, 5 Left, 6 Right |
| 13, 23, 33 | Origin for that orthographic type, relative to this UCS |
Each 71 and 13/23/33 pair sets the origin used for that orthographic view when
UCSBASE is this UCS. With 71 5, 13 1.0,
23 2.0, 33 3.0, choosing LEFT moves the UCS origin to
(1, 2, 3); without the pair, the origin would be this UCS’s own.
VIEW
| Code | Meaning |
|---|---|
| 100 | AcDbViewTableRecord |
| 2 | View name |
| 70 | Flags: 1 paper space view; and the standard 16, 32, 64 |
| 40 | View height (DCS) |
| 10, 20 | View centre point (DCS) |
| 41 | View width (DCS) |
| 11, 21, 31 | View direction from the target (WCS) |
| 12, 22, 32 | Target point (WCS) |
| 42 | Lens length |
| 43 | Front clipping plane, as an offset from the target |
| 44 | Back clipping plane, as an offset from the target |
| 50 | Twist angle |
| 71 | View mode (see the VIEWMODE system variable) |
| 281 | Render mode (below) |
| 72 | 1 if a UCS is associated with this view; 0 otherwise |
| 73 | 1 if the camera is plottable |
| 332 | Soft-pointer handle of the background object (optional) |
| 334 | Soft-pointer handle of the live section object (optional) |
| 348 | Hard-pointer handle of the visual style object (optional) |
| 361 | Hard-owner handle of the sun |
When 72 is 1 these follow, defining the UCS made current whenever the view is restored:
| Code | Meaning |
|---|---|
| 110, 120, 130 | UCS origin |
| 111, 121, 131 | UCS X axis |
| 112, 122, 132 | UCS Y axis |
| 79 | Orthographic type of the UCS: 0 not orthographic, 1 Top, 2 Bottom, 3 Front, 4 Back, 5 Left, 6 Right |
| 146 | UCS elevation |
| 345 | Handle of the UCS table entry if the UCS is named; absent means unnamed |
| 346 | Handle of the base UCS entry if the UCS is orthographic; absent with a nonzero 79 means WORLD |
Render mode (code 281, VIEW and VPORT)
| Value | Meaning |
|---|---|
| 0 | 2D Optimized (classic 2D) |
| 1 | Wireframe |
| 2 | Hidden line |
| 3 | Flat shaded |
| 4 | Gouraud shaded |
| 5 | Flat shaded with wireframe |
| 6 | Gouraud shaded with wireframe |
Every mode except 0 uses the 3D graphics pipeline. The values match the SHADEMODE
command and the AcDbAbstractViewTableRecord::RenderMode enumeration.
VPORT
VPORT may hold several entries with the same name, making up a multiple-viewport
configuration. The entries of the active configuration are all named
*ACTIVE; the first of them is the current viewport.
| Code | Meaning |
|---|---|
| 100 | AcDbViewportTableRecord |
| 2 | Viewport name |
| 70 | Standard flags (16, 32, 64) |
| 10, 20 | Lower-left corner of the viewport |
| 11, 21 | Upper-right corner of the viewport |
| 12, 22 | View centre point (DCS) |
| 13, 23 | Snap base point (DCS) |
| 14, 24 | Snap spacing X and Y |
| 15, 25 | Grid spacing X and Y |
| 16, 26, 36 | View direction from the target point (WCS) |
| 17, 27, 37 | View target point (WCS) |
| 42 | Lens length |
| 43 | Front clipping plane, as an offset from the target |
| 44 | Back clipping plane, as an offset from the target |
| 45 | View height |
| 50 | Snap rotation angle |
| 51 | View twist angle |
| 72 | Circle sides |
| 331 or 441 | Soft- or hard-pointer handle of a frozen layer; repeats for each frozen layer |
| 70 | Bit flags and perspective mode |
| 1 | Plot style sheet |
| 281 | Render mode (0–6, above) |
| 71 | View mode (see the VIEWMODE system variable) |
| 74 | UCSICON setting |
| 110, 120, 130 | UCS origin |
| 111, 121, 131 | UCS X axis |
| 112, 122, 132 | UCS Y axis |
| 345 | Handle of the UCS table entry if the UCS is named; absent means unnamed |
| 346 | Handle of the base UCS entry if the UCS is orthographic; absent with a nonzero 79 means WORLD |
| 79 | Orthographic type of the UCS: 0 not orthographic, 1 Top, 2 Bottom, 3 Front, 4 Back, 5 Left, 6 Right |
| 146 | Elevation |
| 170 | Shade plot setting |
| 61 | Major grid lines |
| 332 | Soft-pointer handle of the background object (optional) |
| 333 | Soft-pointer handle of the shade plot object (optional) |
| 348 | Hard-pointer handle of the visual style object (optional) |
| 292 | Default lighting on |
| 282 | Default lighting type: 0 one distant light, 1 two distant lights |
| 141 | Brightness |
| 142 | Contrast |
| 63, 421, 431 | Ambient colour (colour index, true colour, colour name); written only when not black |
0
TABLE
2
STYLE
5
1C
70
3
1001
APP_X
1040
42.0
0
STYLE
5
3A
2
ENTRY_1
70
64
40
.4
41
1.0
50
0.0
71
0
42
0.4
3
BUFONTS.TXT
0
STYLE
5
C2
2
ENTRY_2
…
BLOCKS section
The BLOCKS section holds every block definition, including the anonymous blocks made by HATCH and associative dimensioning. A definition is a BLOCK entity, the entities of the block in the same format as in ENTITIES, then an ENDBLK entity. BLOCK and ENDBLK appear only here, and definitions never nest, though a block may contain INSERT entities. External references are written as block definitions with a 1 group giving the path and file name.
The UCS in effect when a block is defined becomes the WCS for its entities, with the origin moved to the block’s base point.
Three empty definitions always appear: *Model_Space,
*Paper_Space and *Paper_Space0. The first paper space
layout is *Paper_Space, the second *Paper_Space0, the third
*Paper_Space1 and so on. In ENTITIES, all paper space entities are
written first and then the model space ones; group 67 tells them apart.
BLOCK
| Code | Meaning |
|---|---|
| 0 | BLOCK |
| 5 | Handle |
| 102 | {application_name … }: application-defined group, such as {ACAD_REACTORS (optional) |
| 330 | Soft-pointer handle of the owner object |
| 100 | AcDbEntity |
| 8 | Layer name |
| 100 | AcDbBlockBegin |
| 2 | Block name |
| 70 | Block type flags (below) |
| 10, 20, 30 | Base point |
| 3 | Block name |
| 1 | Xref path name |
| 4 | Block description (optional) |
Block type flags (code 70)
| Bit | Meaning |
|---|---|
| 0 | None of the following |
| 1 | Anonymous block made by hatching, associative dimensioning, other internal operations or an application |
| 2 | Has non-constant attribute definitions (not set if any attribute definition is constant, or there are none) |
| 4 | External reference (xref) |
| 8 | Xref overlay |
| 16 | Externally dependent |
| 32 | Resolved external reference, or dependent of one (ignored on input) |
| 64 | Referenced external reference (ignored on input) |
The block table entry’s handle, with any xdata and persistent reactors, follows each BLOCK record, which carries everything the block table record stores.
ENDBLK
| Code | Meaning |
|---|---|
| 0 | ENDBLK |
| 5 | Handle |
| 102 | Application-defined group (optional) |
| 330 | Soft-pointer handle of the owner object |
| 100 | AcDbEntity |
| 8 | Layer name |
| 100 | AcDbBlockEnd |
Not given by the reference
The reference names but does not list the values of: BLOCK_RECORD 70 (insertion units), 280 (explodability) and 281 (scalability); VPORT 70 (bit flags and perspective mode), 74 (UCSICON) and 170 (shade plot); VIEW and VPORT 71 (VIEWMODE); STYLE 1071 (how the TrueType bits are packed); and DIMSTYLE 276 (DIMFRAC).
Sources
- AutoCAD 2014 DXF Reference – Autodesk, March 2013, chapters 3 (CLASSES), 4 (TABLES) and 5 (BLOCKS), and the symbol table example in chapter 9
- AutoCAD 2012 DXF Reference – Autodesk, February 2011, used only to check the order of the default class table