drawing interchange and file formats release 12(AutoCAD DXF 12.0版文件格式说明)
dxf file format
===============
this section describes the format of a dxf file in detail. it
contains technical information that you need only if you write your
own programs to process dxf files or work with entity information
obtained by certain autolisp and ads functions. it would probably be helpful to produce a dxf file from a small
drawing, print it out, and refer to it occasionally while reading
the information presented next.
general file structure
----------------------
a drawing interchange file is simply an ascii text file with a file
type of .dxf and specially formatted text. the overall organization
of a dxf file is as follows: 1. header section - general information about the drawing is found
in this section of the dxf file. each parameter has a variable
name and an associated value (see table 11-3 for a list of the
header variables). 2. tables section - this section contains definitions of named
items. o linetype table (ltype)
o layer table (layer)
o text style table (style)
o view table (view)
o user coordinate system table (ucs)
o viewport configuration table (vport)
o dimension style table (dimstyle)
o application identification table (appid) 3. blocks section - this section contains block definition entities
describing the entities that make up each block in the drawing. 4. entities section - this section contains the drawing entities,
including any block references. 5. end of file if you use dxfout's entities option, the resulting dxf file contains
only the entities section and the end of file marker, and the
entities section reflects only the objects you select for output. note: if you select an insert entity, the corresponding block
definition is not included in the output file. a dxf file is composed of many groups, each of which occupies two
lines in the dxf file. the first line of a group is a group code,
which is a positive nonzero integer output in fortran i3 - that is,
right-justified and blank filled in a three-character field (the
exception to this is the four-digit extended entity data group
codes, which are output in fortran i4). the second line of the group
is the group value, in a format that depends on the type of group
specified by the group code. although dxfout output has a fixed
format, the dxfin format is free. the specific assignment of group codes depends on the item being
described in the file. however, the type of the value this group
supplies is derived from the group code in the following way: table 11-1. group code ranges
+================================+
| group code | following value |
| range | |
|-------------|------------------|
| 0 - 9 | string |
|-------------|------------------|
| 10 - 59 | floating-point |
|-------------|------------------|
| 60 - 79 | integer |
|-------------|------------------|
| 140 - 147 | floating-point |
|-------------|------------------|
| 170 - 175 | integer |
|-------------|------------------|
| 210 - 239 | floating-point |
|-------------|------------------|
| 999 | comment (string) |
|-------------|------------------|
| 1010 - 1059 | floating-point |
|-------------|------------------|
| 1060 - 1079 | integer |
|-------------|------------------|
| 1000 - 1009 | string |
+--------------------------------+ |