DXF Data Format

Normally a DXF file is organised as follows:

  1. HEADER
  2. TABLES
  3. BLOCKS
  4. ENTITIES
  5. END OF FILE

HEADER

The HEADER section of the DXF file contains variables assigned to drawings. These variables are set by diverse commands, and is the data shown by the STATUS command.

In the HEADER section, each variable is specified by a group 9 code that determines variable, followed by the type of group that determines the value.

Sample: HEADER variables, following groups and their respective values:

Angle direction

Angle unit mode

Upper right point of drawing limits reported in World coordinates

Lower left point of drawing limits reported in World coordinates

Insertion base set with the command BASE


Tables

This section contains definitions of designated functions:

 

The TABLES section of the DXF files contains a number of tables.

The LTYPE table must always precede the LAYER table. The sequence of the remaining tables is arbitrary.

Group 0, TABLE designation, is the first entry in each table. This is followed by a group 2 code, identifying the appropriate table: VPORT, LTYPE, LAYER, STYLE, VIEW, DIMSTYLE, BKS or APPID.

These groups are followed by Group 70, specifying the maximum number of subsequent table entries.

Table names are always written in HIGHCASE..


BLOCKS

The BLOCKS section of the DXF file contains all BLOCK definitions, and thus all drawing objects associated with the relevant blocks.

All objects in the BLOCK section appear between BLOCK and WNDBLK objects.

Block definitions are never nested, i.e. a BLOCK is never inserted between another BLOCK - ENDBLK pair.


Entities

The ENTITIES section of the DXF file contains object elements. The first entry, for each object begins with a group 0 code, i.e. object identification.

Each object possesses a group 8 code designating the layer on which the object is located. It is also possible to assign elevation or object thickness/height data as well as line type or colour information to each object.


End of File

A DXF file always ends with the entry, END OF FILE: EOF.


Groups

A DXF file is made up of a number of GROUPS, with each group occupying two lines. The first line contains the group code, while the second specifies the group value. Format is dependent on the type of group.

Group code assignment is dependent on the type of element being described.

Group codes are used to designate the type and overall application of the group.

Groups with file delimiters (group code 0) serve the purpose of delimiting the file sections.

2-D Interfaces