DXF Group Codes
TABLES Section |
Symbol Tables in DXF Files
|
The order of the tables may change, but the LTYPE table always precedes the LAYER table. Each table is introduced with a 0 group with the label TABLE. This is followed by a 2 group identifying the particular table (APPID, DIMSTYLE, LAYER, LTYPE, STYLE, UCS, VIEW, VPORT, or BLOCK_RECORD), a 5 group (a handle), a group 100 (AcDbSymbolTable subclass marker), and a 70 group that specifies the maximum number of table entries that may follow. Table names are output in uppercase characters. The DIMSTYLE handle is a 105 group not a 5 group.
The tables in a drawing can contain deleted items, but these are not written to the DXF file. As a result, fewer table entries may follow the table header than are indicated by the 70 group, so do not use the count in the 70 group as an index to read in the table. This group is provided so that a program that reads DXF files can allocate an array large enough to hold all the table entries that follow.
Following this header for each table are the table entries. Each table item consists of a 0 group identifying the item type (same as table name, such as LTYPE or LAYER), a 2 group giving the name of the table entry, a 70 group specifying flags relevant to the table entry (defined for each following table), and additional groups that give the value of the table entry. The end of each table is indicated by a 0 group with the value ENDTAB.
The following is an example of the TABLES section of a DXF file. 0 |
Beginning of TABLES section |
0 |
Common table group codes, |
0 |
Table entry data, repeats, |
0 |
End of table |
0 |
End of TABLES section |
Both symbol table records and symbol tables are database objects. At a very minimum, with all prevailing usage within AutoCAD, this implies that a handle is present, positioned after the 2 group codes for both the symbol table record objects and the symbol table objects.
The DIMSTYLE table is the only record type in the system with a handle code of 105 because of its earlier usage of group code 5. As a rule, programmers should not be concerned about this exception unless it is in the context of the DIMSTYLE table section. This is the only context in which this exception should occur.