Copyright: Copyright © 1998 Autodesk, Inc. [v.u14.1.04]


DXF Reference  [DXF]
DXF Reference

 Overview

The information in this document can also be found in appendixes B and C of the AutoCAD Customization Guide. Any updates to this document will be available from our Web site at http://www.autodesk.com/techpubs/autocad/dxf/. Or you can contact us by email at acad_docs@autodesk.com. When inquiring about DXF Reference updates, please refer to this file's version number. The version number of this file is u14.1.04.

Topics in this file:

   Drawing Interchange File Formats

   ASCII DXF File Format

   Binary DXF File Format

   DXB Files

   Slide File Format

   Slide Library File Format

   DXF Group Codes

   General DXF Conventions

   HEADER Section

   CLASSES Section

   TABLES Section

   BLOCKS Section

   ENTITIES Section

   OBJECTS Section

   Advanced DXF Issues


Drawing Interchange File Formats  [ACG]
Drawing Interchange File Formats

 Overview

AutoCAD can be used as a complete drawing editor. However, in some applications, other programs must examine AutoCAD drawings or generate drawings to be viewed, modified, or plotted with AutoCAD. Five types of file formats for importing and exporting drawing data are described in this appendix.

Drawing Interchange Format (DXF) files enable the interchange of drawings between AutoCAD and other programs. DXF files can be either ASCII or binary formats. Because ASCII DXF files are more common than the binary format, this chapter uses the term DXF file when referring to ASCII DXF files and the term binary DXF files when referring to the binary format.

Both ASCII and binary DXF files contain a complete description of the AutoCAD drawing. Because much of the data in an AutoCAD drawing does not have an equivalent object type in other programs, the Drawing Interchange Binary (DXB) file format is provided, which creates a simpler geometric description of the drawing.

This appendix also presents the Slide file format and the Slide Library file format.

Topics in this chapter:

   ASCII DXF File Format

   Binary DXF File Format

   DXB Files

   Slide File Format

   Slide Library File Format


ASCII DXF File Format  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

This section describes the format of ASCII DXF files. It contains information that is needed only if you write your own programs to process DXF files or work with entity information obtained by AutoLISP and ARX applications.

Topics in this section:

   General File Structure

   Symbol Table Example

   Writing DXF Interface Programs


General File Structure  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

  General File Structure

Essentially a DXF file is composed of pairs of codes and associated values. The codes, known as group codes, indicate the type of value that follows. Using these group code and value pairs, a DXF file is organized into sections, which are composed of records, which in turn are composed of a group code and a data item. Each group code and value are on their own line in the DXF file.

Each section starts with a group code 0 followed by the string, SECTION. This is followed by a group code 2 and a string indicating the name of the section (for example, HEADER). Each section is composed of group codes and values that define its elements. A section ends with a 0 followed by the string ENDSEC.

It may be helpful to produce a DXF file from a small drawing, print it out, and refer to it while reading the information presented next.

Topics in this section:

   DXF File Structure

   Group Codes


DXF File Structure  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

  General File Structure

   DXF File Structure

The overall organization of a DXF file is as follows:

HEADER section. General information about the drawing is found in this section. It consists of an AutoCAD database version number and a number of system variables. Each parameter contains a variable name and its associated value.

CLASSES section. Holds the information for application-defined classes, whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. A class definition is permanently fixed in class hierarchy.

TABLES section. This section contains definitions for the following symbol tables.

APPID (application identification table)

BLOCK_RECORD (block reference table)

DIMSTYLE (dimension style table)

LAYER (layer table)

LTYPE (linetype table)

STYLE (text style table)

UCS (User Coordinate System table)

VIEW (view table)

VPORT (viewport configuration table)

BLOCKS section. Contains block definition and drawing entities that make up each block reference in the drawing.

ENTITIES section. This section contains the graphical objects (entities) in the drawing, including block references (insert entities).

OBJECTS section. Contains the nongraphical objects in the drawing. All objects that are not entities or symbol table records or symbol tables are stored in this section. Examples of entries in the OBJECTS section are dictionaries that contain mline styles and groups.

If you use the Entities option of the DXFOUT command, the resulting DXF file contains only the ENTITIES section and the EOF marker. The ENTITIES section contains only the objects you select for output. If you select an insert entity, the corresponding block definition is not included in the output file.


Group Codes  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

  General File Structure

   Group Codes

Group codes and the associated values define a specific aspect of an object or entity. The line immediately following the group code is the associated value. This value can be a a string, an integer, or a floating-point value, such as the X coordinate of a point. The lines following the second line of the group, if any, are determined by the group definition and the data associated with the group.

Special group codes are used as file separators, such as markers for the beginning and end of sections, tables, and the end of the file itself.

Entities, objects, classes, tables and table entries, and file separators are introduced with a 0 group code that is followed by a name describing the group.

The maximum DXF file string length is 256 characters. If your AutoCAD drawing contains strings that exceed this number, those strings are truncated during DXFOUT. DXFIN fails if your DXF file contains strings that exceed this number.

ASCII Control Characters

DXFOUT handles ASCII control characters in text strings by expanding the character into a caret (^) followed by the appropriate letter. For example, an ASCII Control-G (BEL, decimal code 7) is output as ^G. If the text itself contains a caret character, it is expanded to caret, space (^ ). DXFIN performs the complementary conversion.


Symbol Table Example  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

  Symbol Table Example

This DXF sequence represents three full objects: the symbol table itself plus two entries.

  0

TABLE           	It's a table, but what kind?

  2

STYLE           	This kind. Exception to rule that code 0 fully defines type.

  5

1C              	STYLE table handle; same as for entities and other objects.

 70

3               	Maximum number of STYLE table records to follow (pre-Release 13 field).

1001

APP_X           	APP_X has put xdata on a symbol table.

1040

42.0            	Just a single floating-point number.

  0

STYLE           	Beginning of first element in the STYLE symbol table.

  5

3A              	The first entry's handle. (DIMSTYLE entries will have 105 here.)

  2

ENTRY_1         	The first entry's text name.

 70

64              	Standard flag values.

 40

.4              	Text height.

 41

1.0             	Width scale factor.

 50

0.0             	Oblique angle.

 71

0               	Text generation flags.

 42

0.4             	Last height used.

  3

BUFONTS.TXT     	Primary font file name.

  0

STYLE           	Second entry begins. No xdata or persistent reactors on first entry.

  5

C2              	Second entry handle.

  2

ENTRY_2         	Second entry text name.

...

...             	Other fields down to group code 3.

  3

BUFONTS.TXT     	Primary font file name and last object type--specific group.

102

{ACAD_REACTORS  	This entry has a couple of persistent reactors.

330

3C2             	Soft ID to first reactor object.

330

41B             	Soft ID to first reactor object.

102

}               	Indicates the end of the reactor set.

1001

APP_1           	Xdata attached to this entry.

1070

45

1001

APP_2

1004

18A5B3EF2C199A

  0

UCS             	Start of UCS table (and end of previous record and table).


Writing DXF Interface Programs  [ACG]
Drawing Interchange File Formats

 ASCII DXF File Format

  Writing DXF Interface Programs

Writing a program that communicates with AutoCAD by means of the DXF mechanism appears more difficult than it actually is. The DXF format makes it easy to ignore information you don't need, while reading the information you do need.

The following example is a Microsoft BASIC™ program that reads a DXF file and extracts all the line entities from the drawing (ignoring lines that appear inside blocks). It displays the endpoints of these lines on the screen. This program is an example of how simple a DXF-reading program can be.

1000  REM

1010  REM Extract lines from DXF file

1020  REM

1030  G1% = 0

1040  LINE INPUT "DXF file name: "; A$

1050  OPEN "i", 1, A$ + ".dxf"

1060  REM

1070  REM Ignore until section start encountered

1080  REM

1090  GOSUB 2000

1100  IF G% <> 0 THEN 1090

1110  IF S$ <> "SECTION" THEN 1090

1120  GOSUB 2000

1130  REM

1140  REM Skip unless ENTITIES section

1150  REM

1160  IF S$ <> "ENTITIES" THEN 1090

1170  REM

1180  REM Scan until end of section, processing LINEs

1190  REM

1200  GOSUB 2000

1210  IF G% = 0 AND S$ = "ENDSEC" THEN 2200

1220  IF G% = 0 AND S$ = "LINE" THEN GOSUB 1400 : GOTO 1210

1230  GOTO 1200

1400  REM

1410  REM Accumulate LINE entity groups

1420  REM

1430  GOSUB 2000

1440  IF G% = 10 THEN X1 = X : Y1 = Y : Z1 = Z

1450  IF G% = 11 THEN X2 = X : Y2 = Y : Z2 = Z

1460  IF G% = 0 THEN PRINT "Line from

 (";X1;",";Y1;",";Z1;") to (";X2;",";Y2;",";Z2;")":RETURN

1470  GOTO 1430

2000  REM

2010  REM Read group code and following value

2020  REM For X coordinates, read Y and possibly Z also

2030  REM

2040  IF G1% < 0 THEN G% = -G1% : G1% = 0 ELSE INPUT #1, G%

2050  IF G% < 10 OR G% = 999 THEN LINE INPUT #1, S$ : RETURN

2060  IF G% >= 38 AND G% <= 49 THEN INPUT #1, V : RETURN

2080  IF G% >= 50 AND G% <= 59 THEN INPUT #1, A : RETURN

2090  IF G% >= 60 AND G% <= 69 THEN INPUT #1, P% : RETURN

2100  IF G% >= 70 AND G% <= 79 THEN INPUT #1, F% : RETURN

2110  IF G% >= 210 AND G% <= 219 THEN 2130

2115  IF G% >= 1000 THEN LINE INPUT #1, T$ : RETURN

2120  IF G% >= 20 THEN PRINT "Invalid group code";G% : STOP

2130  INPUT #1, X

2140  INPUT #1, G1%

2150  IF G1% <> (G%+10) THEN PRINT "Invalid Y coord code";

 G1% : STOP

2160  INPUT #1, Y

2170  INPUT #1, G1%

2180  IF G1% <> (G%+20) THEN G1% = -G1% ELSE INPUT #1, Z

2190  RETURN

2200  CLOSE 1

Writing a program that constructs a DXF file poses different problems. You must maintain consistency within the drawing, although with AutoCAD you can omit many items in a DXF file and still obtain a usable drawing. The entire HEADER section can be omitted if you don't set header variables. Any of the tables in the TABLES section can be omitted if you don't need to make entries, and the entire TABLES section can be dropped if nothing in it is required. If you define any linetypes in the LTYPE table, this table must appear before the LAYER table. If no block definitions are used in the drawing, the BLOCKS section can be omitted. If present, the BLOCKS section must appear before the ENTITIES section. Within the ENTITIES section, you can reference layer names even though you haven't defined them in the LAYER table. Such layers are automatically created with color 7 and the CONTINUOUS linetype. The EOF item must be present at the end of file.

The following Microsoft BASIC program constructs a DXF file representing a polygon with a specified number of sides, leftmost origin point, and side length. This program supplies only the ENTITIES section of the DXF file and places all entities generated on the default layer 0. Because this program doesn't create the drawing header, the drawing limits, extents, and current view will be invalid after performing a DXFIN on the drawing generated by this program. You can do a ZOOM Extents to fill the screen with the drawing generated. Then adjust the limits manually.

1000  REM

1010  REM Polygon generator

1020  REM

1030  LINE INPUT "Drawing (DXF) file name: "; A$

1040  OPEN "o", 1, A$ + ".dxf"

1050  PRINT #1, 0

1060  PRINT #1, "SECTION"

1070  PRINT #1, 2

1080  PRINT #1, "ENTITIES"

1090  PI = ATN(1) * 4

1100  INPUT "Number of sides for polygon: "; S%

1110  INPUT "Starting point (X,Y): "; X, Y

1120  INPUT "Polygon side: "; D

1130  A1 = (2 * PI) / S%

1140  A = PI / 2

1150  FOR I% = 1 TO S%

1160  PRINT #1, 0

1170  PRINT #1, "LINE"

1180  PRINT #1, 8

1190  PRINT #1, "0"

1200  PRINT #1, 10

1210  PRINT #1, X

1220  PRINT #1, 20

1230  PRINT #1, Y

1240  PRINT #1, 30

1250  PRINT #1, 0.0

1260  NX = D * COS(A) + X

1270  NY = D * SIN(A) + Y

1280  PRINT #1, 11

1290  PRINT #1, NX

1300  PRINT #1, 21

1310  PRINT #1, NY

1320  PRINT #1, 31

1330  PRINT #1, 0.0

1340  X = NX

1350  Y = NY

1360  A = A + A1

1370  NEXT I%

1380  PRINT #1, 0

1390  PRINT #1, "ENDSEC"

1400  PRINT #1, 0

1410  PRINT #1, "EOF"

1420  CLOSE 1

As long as a properly formatted item appears on the line on which the data is expected, DXFIN accepts it. (Of course, string items should not have leading spaces unless these are intended to be part of the string.) This program takes advantage of this flexibility in input format and does not generate a file exactly like one generated by AutoCAD.

In the case of an error in using DXFIN TO load, AutoCAD reports the error with a message indicating the nature of the error and the last line processed in the dxf file before the error was detected. This may not be the line on which the error occurred, especially in the case of errors such as the omission of required groups.


Binary DXF File Format  [ACG]
Drawing Interchange File Formats

 Binary DXF File Format

The ASCII DXF file format is a complete representation of an AutoCAD drawing in an ASCII text form, and is easily processed by other programs. In addition, AutoCAD can produce or read a binary form of the full DXF file and accept limited input in another binary file format.

The DXFOUT command provides a Binary option that writes binary dxf files. Such a file contains all of the information present in an ASCII DXF file but in a more compact form that takes, typically, 25 percent less file space and can be read and written more quickly (typically, five times faster) by AutoCAD. Unlike ASCII dxf files, which entail a trade-off between size and floating-point accuracy, binary dxf files preserve all of the accuracy in the drawing database. (AutoCAD Release 10 was the first version to support this form of DXF file; it cannot be read by older versions.)

A binary DXF file begins with a 22-byte sentinel consisting of the following:

AutoCAD Binary DXF<CR><LF><SUB><NULL>

Following the sentinel are pairs (group, value) as in an ASCII DXF file but represented in binary form. The group code is a single-byte binary value, and the value that follows is one of the following:

A 2-byte integer with the least significant byte first and the most significant byte last

An 8-byte IEEE double-precision floating-point number stored with the least significant byte first and the most significant byte last

An ASCII string terminated by a 0 (NULL) byte

The type of the datum following a group is determined from the group code by the same rules used in decoding ASCII DXF files. Translation of angles to degrees and dates to fractional Julian date representation is performed for binary files, as well as for ASCII DXF files. The comment group, 999, is not used in binary DXF files.

Extended data group codes are represented in binary DXF as a single byte with the value 255, followed by a 2-byte integer value containing the actual group code, followed by the actual value.

Extended data long (group code 1071) values occupy 4 bytes of data. Extended data binary chunks (group code 1004) are represented as a single-byte, unsigned integer length, followed by the specified number of bytes of chunk data. For example, to transfer an extended data long group, the following values would appear, occupying 1, 2, and 4 bytes respectively.

255                    	Escape group code

1071                   	True group code

999999                 	Value for the 1071 group code

DXFOUT writes binary DXF files with the same file type (.dxf) as for ASCII DXF files. The DXFIN command automatically recognizes a binary file by means of its sentinel string. There is no need for you to identify it as a binary file.

If DXFIN encounters an error in a binary DXF file, it reports the byte address within the file where the error was detected.


DXB Files  [ACG]
Drawing Interchange File Formats

 DXB Files

The DXF file formats are complete representations of an AutoCAD drawing that can be written and read by AutoCAD and other programs. However, programs executed by means of the external commands facility often need to supply simple geometric input to AutoCAD. For these purposes, AutoCAD supports another file format, called DXB (drawing interchange binary), which is limited in the entities it can represent.

To load a DXB file, enter the DXBIN command:

dxbin

When AutoCAD prompts you, respond with the name of the file you want to load. You do not need to include a .dxb file because the type is assumed.

There is no direct AutoCAD command for writing a DXB file, but the ADI "AutoCAD file output formats" plotter driver can write such a file. If you want to create a DXB file from an AutoCAD drawing, configure the "file output formats" plotter and select its "AutoCAD DXB file" output option.

Topics in this section:

   The DXB File Format


The DXB File Format  [ACG]
Drawing Interchange File Formats

 DXB Files

  The DXB File Format

This information is for experienced programmers and is subject to change without notice.

The format of a DXB file is as follows:

Header: "AutoCAD DXB 1.0" CR LF ^Z NUL 	(19 bytes)

Data: 	...Zero or more data records...

Terminator: NUL 	(1 byte)

Each data record begins with a single byte identifying the record type, followed by data items. The data items have various forms of representation and encoding. In the following descriptions of the letter codes, each data item is prefixed with a letter and a hyphen.

w-

16-bit integer, byte reversed in the standard 80x86 style the least significant byte first, and the most significant byte second).

f-

IEEE 64-bit floating-point value stored with LSB first, MSB last (as stored by an 80x87).

l-

32-bit integer with the bytes reversed 80x86 style.

n-

Either a 16-bit integer or a floating-point number, depending on the most recent setting of the number mode data item. The number mode defaults to 0, signifying integers. If set to 1, all n- items will be read as floating point.

u-

Either a 32-bit integer or a floating-point number, depending on the most recent number mode setting. If a 32-bit integer, the value is scaled by multiplying it by 65,536 (216). If a floating-point value, no scaling is applied.

a-

An angle. If number mode is integer, this is a 32-bit integer representing an angle in units of millionths of a degree (range 0 to 360,000,000). If a floating-point number, it represents degrees.

In the following table, the lengths include the item-type byte and assume that the number mode is set to 0 (integer mode). If number mode is floating point, add 6 bytes to the length for each n- item present and 4 bytes for each a- or u- item present.

Byte length for item types

Item type	Code (decimal)	Data items	Length  (bytes)
Line	1	n-fromx n-fromy n-tox n-toy n-fromx n-fromy n-fromz n-tox n-toy n-toz	13
Point	2	n-x n-y	5
Circle	3	n-ctrx n-ctry n-rad	7
Arc	8	n-ctrx n-ctry n-rad a-starta a-enda	19
Trace	9	n-x1 n-y1 n-x2 n-y2 n-x3 n-y3 n-x4 n-y4	17
Solid	11	n-x1 n-y1 n-x2 n-y2 n-x3 n-y3 n-x4 n-y4	17
Seqend	17	(none)	1
Polyline	19	w-closureflag	3
Vertex	20	n-x n-y	5
3Dface	22	n-x1 n-y1 n-z1 n-x2 n-y2 n-z2 n-x3 n-y3 n-z3 n-x4 n-y4 n-z4	25
Scale factor	128	f-scalefac	9
New layer	129	"layername" NUL	layername length + 2
Line extension	130	n-tox n-toy	5
Trace extension	131	n-x3 n-y3 n-x4 n-y4	9
Block base	132	n-bx n-by	5
Bulge	133	u-2h/d	5
Width	134	n-startw n-endw	5
The line extension item extends the last line or line extension from its To point to a new To point. The trace extension item extends the last trace solid, or trace extension from its x3,y3-x4,y4 ending line to a new x3,y3--x4,y4 line.

The scale factor is a floating-point value by which all integer coordinates are multiplied to obtain the floating-point coordinates used by the entities. The initial scale factor when a file is read is 1.0. The new layer item creates a layer if none exists, giving the new layer the same defaults as the LAYER New command, and sets that layer as the current layer for subsequent entities. At the end of the DXB file load, the layer in effect before the command is restored.

The block base item specifies the base (origin) point of a created block. The block base must be defined before the first entity record is encountered. If DXB does not define a block, this specification is ignored.

A polyline consists of straight segments of fixed width connecting the vertices, except as overridden by the bulge and width items. The closure flag should be 0 or 1; if it is 1, there is an implicit segment from the last vertex (immediately before the Seqend) to the first vertex.

A bulge item, encountered between two vertex items (or after the last vertex of a closed polyline), indicates that the two vertices are connected by an arc rather by than a straight segment. If the distance between the vertices has length d, and the perpendicular distance from the midpoint of that segment to the arc is h, then the magnitude of the bulge is (2 * h / d). The sign is negative if the arc from the first vertex to the second is clockwise. A semicircle thus has a bulge of 1 (or -1). If the number mode is 0 (integer), bulge items are scaled by 2 16. If the number mode has been set to floating point, then the floating-point value supplied is 2*h/d (not scaled).

The width item indicates the starting and ending widths of the segment (straight or curved) connecting two vertices. This width stays in effect until the next width item or the seqend. If there is a width item between the polyline item and the first vertex, it is stored as a default width for the polyline. This saves considerable database space if the polyline has several segments of this width.

The number mode item controls the mode of items with types given in the preceding table as n-, a-, or u-. If the value supplied is 0, these values will be integers; otherwise, they are floating point.

To remember the last to-point, lines share the same cells, so do not mix extension groups for the two entities without an initial group before the extension. There is no extension group for 3D faces, because there is no obvious edge to extend from.

The new color group specifies the color for subsequent entities in the DXB file. The w-colornum word argument is in the range from 0 to 256. 0 means color by block, 1-255 are the standard AutoCAD colors, and 256 means color by layer. A color outside the range from 0 to 256 sets the color back to the current entity color (you can do this deliberately, and it can be quite useful). The initial entity color of material added by DXBIN is the current entity color.

All points specified in the DXB file are interpreted in terms of the current UCS at the time that the DXBIN command is executed.


Slide File Format  [ACG]
Drawing Interchange File Formats

 Slide File Format

Note  This information is for experienced programmers, and is subject to change without notice.

AutoCAD slide files are screen images written by the MSLIDE command and read by the VSLIDE command. This section describes the format of slide files for the benefit of developers who wish to incorporate support for AutoCAD slides into their programs.

A slide file consists of a header portion (31 bytes) and one or more data records of variable length. All coordinates and sizes written to the slide file reflect the graphics area of the display device from which the slide was created with point (0,0) located at the lower-left corner of the graphics area. For AutoCAD Release 9 and later, the slide file header consists of the following fields:

Slide file header

Field	Bytes	Description
ID string	17	"AutoCAD Slide" CR LF ^Z NUL
Type indicator	1	Currently set to 56 (decimal)
Level indicator	1	Currently set to 2
High X dot	2	Width of the graphics area: 1, in pixels
High Y dot	2	Height of the graphics area: 1, in pixels
Aspect ratio	4	Graphics area aspect ratio (horizontal size/vertical size in inches), scaled by 10,000,000. This value is always written with the least significant byte first.
Hardware fill	2	Either 0 or 2 (value is unimportant)
Test number	2	A number (1234 hex) used to determine whether all 2-byte values in the slide were written with the high-order byte first (Intel 8086-family CPUs) or the low-order byte first (Motorola 68000-family CPUs)
Data records follow the header. Each data record begins with a 2-byte field whose high-order byte is the record type. The remainder of the record may be composed of 1-byte or 2-byte fields as described in the following table. To determine whether the 2-byte fields are written with the high-order byte first or the low-order byte first, examine the Test number field of the header that is described earlier.

Slide file data records

Record type  (hex)	Bytes	Meaning	Description
00-7F	8	Vector	The from-X coordinate for an ordinary vector. From-Y, to-X, and to-Y follow in that order as 2-byte values. The from point is saved as the last point.
80-FA	--	Undefined	Reserved for future use.
FB	5	Offset vector	The low-order byte and the following three bytes specify the endpoints (from-X, from-Y, to-X, to-Y) of a vector, in terms of offsets (-128 to +127) from the saved last point. The adjusted from point is saved as the last point for use by subsequent vectors.
FC	2	End of file	The low-order byte is 00.
FD	6	Solid fill	The low-order byte is always zero. The following two 2-byte values specify the X and Y coordinates of one vertex of a polygon to be solid filled. Three to ten such records occur in sequence. A Solid fill record with a negative Y coordinate indicates the start or end of such a flood sequence. In the start record, the X coordinate indicates the number of vertex records to follow.
FE	3	Common endpoint vector	This is a vector starting at the last point. The low-order byte and the following byte specify to-X and to-Y in terms of offsets (-128 to +127) from the saved last point. The adjusted to point is saved as the last point for use by subsequent vectors.
FF	2	New color	Subsequent vectors are to be drawn using the color number indicated by the low-order byte.
If a slide contains any vectors at all, a New color record will be the first data record. The order of the vectors in a slide, and the order of the endpoints of those vectors, may vary.

For example, the following is an annotated hex dump of a simple slide file created on an IBM PC/AT with an IBM Enhanced Graphics Adapter. The slide consists of a white diagonal line from the lower-left corner to the upper-right corner of the graphics area, a green vertical line near the lower-left corner, and a small red rectangle at the lower-left corner.

41 75 74 6F 43 41         ID string ("AutoCAD Slide" CR LF ^Z NUL)

44 20 53 6C 69 64

65 0D 0A 1A 00

56                        Type indicator (56)

02                        Level indicator (2)

3C 02                     High X dot (572)

24 01                     High Y dot (292)

0B 80 DF 00               Aspect ratio (14,647,307 / 10,000,000 = 1.46)

02 00                     Hardware fill (2)

34 12                     Test number (1234 hex)

07 FF                     New color (7 = white)

3C 02 24 01 00 00 00 00   Vector from 572,292 to 0,0. 572,292 becomes
                          "last" point

3 FF                      New color (3 = green)

0F 00 32 00 0F 00 13 00   Vector from 15,50 to 15,19. \x1115,50 becomes
                          "last" point

01 FF                     New color (1 = red)

12 FB E7 12 CE            Offset vector from 15+18,50-25 (33,25) to 15+18,50-
                          50 (33,0). 33,25 becomes "last" point

DF FE 00                  Common-endpoint vector from 33,25 to 33-33,25+0
                           (0,25). 0,25 becomes "last" point

00 FE E7                  Common-endpoint vector from (0,25) to 0+0,25-25
                           (0,0). 0,0 becomes "last" point

21 FE 00                  Common-endpoint vector from (0,0) to 0+33,0+0
                           (33,0).33,0 becomes "last" point

00 FC                     End of file

Topics in this section:

   Old Slide Header


Old Slide Header  [ACG]
Drawing Interchange File Formats

 Slide File Format

  Old Slide Header

The slide format described in the previous section is produced by AutoCAD Release 9 and later, and is portable among all computers running AutoCAD Release 9 or later. Previous versions of AutoCAD (as well as AutoShade 1.0 and AutoSketch 1.02) produce slides with a somewhat different header, as shown in the following table.

Old slide file header format

Field	Bytes	Description
ID string	17	"AutoCAD Slide" CR LF ^Z NUL
Type indicator	1	56 (decimal)
Level indicator	1	1 (old format)
High X dot	2	Width of the graphics area: 1, in pixels
High Y dot	2	Height of the graphics area: 1, in pixels
Aspect ratio	8	Graphics area aspect ratio (horizontal size/vertical size in inches), written as a floating-point number
Hardware fill	2	Either 0 or 2 (value is unimportant)
Filler byte	1	Unused
Note that the old-format header does not contain a Test number field. The floating-point aspect ratio value and all 2-byte integers are written in the native format of the CPU that was used to create the file (for 8086-family CPUs, IEEE double-precision, and low-order byte first). Old-format slide files are not portable across machine types, but they can be read by any version of AutoCAD running on the same CPU type as the CPU with which the slide was created.


Slide Library File Format  [ACG]
Drawing Interchange File Formats

 Slide Library File Format

This section describes the format of AutoCAD slide libraries (Release 9 and later) for the benefit of developers who wish to incorporate support for slide libraries into their programs.

The general format of a slide library is as follows:

"AutoCAD Slide Library 1.0" CR LF ^Z NUL NUL NUL NUL  Header (32 bytes)

One or more slide directory entries (36 bytes each)

One or more slides (variable length)

Slide directory entries have the following format:

Slide name (NUL terminated) (32 bytes)

Address of slide within library file (4 bytes)

The slide address is always written with the low-order byte first. Each slide to which the directory points is a complete slide file as described in the previous section. The end of the slide directory is signified by an entry with a null slide name (first byte is NUL). A slide library can contain a mixture of old-format and new-format slides.


DXF Group Codes  [ACG]
DXF Group Codes

 Overview

This chapter describes the DXF group codes found in DXF files and encountered by AutoLISP and ARX applications. The first section provides general information about DXF group codes. It lists the group codes in numerical order and organizes them by object type. (For descriptions of the AutoLISP functions that use group codes, see chapter 9, "Selection Set, Object, and Symbol Table Functions.") The remaining sections list and describe the group codes in the order that they are found in DXF files.

Topics in this chapter:

   General DXF Conventions

   HEADER Section

   CLASSES Section

   TABLES Section

   BLOCKS Section

   ENTITIES Section

   OBJECTS Section

   Advanced DXF Issues


General DXF Conventions  [ACG]
DXF Group Codes

 General DXF Conventions

The DXF format is a tagged data representation of all the information contained in an AutoCAD drawing file of a specific version. Tagged data means that each data element in the file is preceded by an integer number that is called a group code. A group code's value indicates what type of data element follows. It also indicates the meaning of a data element for a given object (or record) type. Virtually all user-specified information in a drawing file can be represented in DXF format. The DXF format is essentially the same when used with applications (AutoLISP and ARX). However, there are a few minor differences for some data groups.

For specific information about the format of DXF files, see appendix B, "Drawing Interchange File Formats."

The group codes shown in this section can apply to DXF files, applications (AutoLISP or ARX), or both. When the description of a code is different for applications and DXF files (or only applies to one or the other), the description is preceeded by the following indicators:

APP   	Application-specific description

DXF   	DXF file-specific description

If the description is common to both DXF files and applications, no indicator is provided. Otherwise, the appropriate indicator is present.

Topics in this section:

   Group Code Ranges

   Group Codes in Numerical Order

   Object and Entity Codes


Group Code Ranges  [ACG]
DXF Group Codes

 General DXF Conventions

  Group Code Ranges

Group codes define the type of the associated value as an integer, a floating-point number, or a string, according to the following table of group code ranges.

Group code ranges

Code range	Group value type
0-9	String (255 characters maximum; less for Unicode strings)
10-59	Double precision 3D point
60-79	16-bit integer value
90-99	32-bit integer value
100	String (255 characters maximum; less for Unicode strings)
102	String (255 characters maximum; less for Unicode strings)
105	String representing hexadecimal (hex) handle value
140-147	Double precision scalar floating-point value
170-175	16-bit integer value
280-289	8-bit integer value
300-309	Arbitrary text string
310-319	String representing hex value of binary chunk
320-329	String representing hex handle value
330-369	String representing hex object IDs
999	Comment (string)
1000-1009	String (255 characters maximum; less for Unicode strings)
1010-1059	Floating-point value
1060-1070	16-bit integer value
1071	32-bit integer value


Group Codes in Numerical Order  [ACG]
DXF Group Codes

 General DXF Conventions

  Group Codes in Numerical Order

The following table gives the group code or group code range accompanied by an explanation of the group code value. In the table, "fixed" indicates that this group code always has the same purpose. The purpose of group codes that aren't fixed can vary depending on the context.

Entity group codes by number

Group code	Description
-5	APP: persistent reactor chain
-4	APP: conditional operator (used only with ssget)
-3	APP: extended data (XDATA) sentinel (fixed)
-2	APP: entity name reference (fixed)
-1	APP: entity name. This changes each time a drawing is opened. It is never saved. (fixed)
0	Text string indicating the entity type (fixed)
1	Primary text value for an entity
2	Name (attribute tag, block name, and so on)
3-4	Other textual or name values
5	Entity handle. Text string of up to 16 hexadecimal digits (fixed)
6	Linetype name (fixed)
7	Text style name (fixed)
8	Layer name (fixed)
9	DXF: variable name identifier (used only in HEADER section of the DXF file).
10	Primary point. This is the start point of a line or text entity, center of a circle, and so on.  DXF: X value of the primary point (followed by Y and Z value codes 20 and 30) APP: 3D point (list of three reals)
11-18	Other points.  DXF: X value of other points (followed by Y value codes 21-28 and Z value codes 31-38) APP: 3D point (list of three reals)
20, 30	DXF: Y and Z values of the primary point
21-28, 31-37	DXF: Y and Z values of other points
38	DXF: entity's elevation if nonzero.
39	Entity's thickness if nonzero (fixed)
40-48	Floating-point values (text height, scale factors, and so on)
48	Linetype scale. Floating-point scalar value. Default value is defined for all entity types.
49	Repeated floating-point value. Multiple 49 groups may appear in one entity for variable-length tables (such as the dash lengths in the LTYPE table). A 7x group always appears before the first 49 group to specify the table length.
50-58	Angles (output in degrees to DXF files and radians through AutoLISP and ARX applications).
60	Entity visibility. Integer value. Absence or 0 indicates visibility; 1 indicates invisibility.
62	Color number (fixed)
66	"Entities follow" flag (fixed)
67	Space--that is, model or paper space (fixed)
68	APP: identifies whether viewport is on but fully off screen; is not active or is off.
69	APP: viewport identification number.
70-78	Integer values, such as repeat counts, flag bits, or modes
90-99	32-bit integer values
100	Subclass data marker (with derived class name as a string). Required for all objects and entity classes that are derived from another concrete class to segregate data defined by different classes in the inheritance chain for the same object. This is in addition to the requirement for DXF names for each distinct concrete class derived from ARX (see "Subclass Markers").
102	Control string, followed by "{<arbitrary name>" or "}". Similar to the xdata 1002 group code, except that when the string begins with "{", it can be followed by an arbitrary string whose interpretation is up to the application. The only other allowable control string is "}" as a group terminator. As noted before, AutoCAD does not interpret these strings except during drawing audit operations; they are for application use.
105	DIMVAR symbol table entry object handle
210	Extrusion direction (fixed).  DXF: X value of extrusion direction APP: 3D extrusion direction vector
220, 230	DXF: Y and Z values of the extrusion direction
280-289	8-bit integer values
300-309	Arbitrary text strings
310-319	Arbitrary binary chunks with same representation and limits as 1004 group codes: hexadecimal strings of up to 254 characters represent data chunks of up to 127 bytes.
320-329	Arbitrary object handles. Handle values that are taken "as is." They are not translated during INSERT and XREF operations.
330-339	Soft-pointer handle. Arbitrary soft pointers to other objects within same DXF file or drawing. Translated during INSERT and XREF operations.
340-349	Hard-pointer handle. Arbitrary hard pointers to other objects within same DXF file or drawing. Translated during INSERT and XREF operations.
350-359	Soft-owner handle. Arbitrary soft ownership links to other objects within same DXF file or drawing. Translated during INSERT and XREF operations.
360-369	Hard-owner handle. Arbitrary hard ownership links to other objects within same DXF file or drawing. Translated during INSERT and XREF operations.
999	DXF: The 999 group code indicates that the line following it is a comment string. DXFOUT does not include such groups in a DXF output file, but DXFIN honors them and ignores the comments. You can use the 999 group to include comments in a DXF file that you've edited.
1000	ASCII string (up to 255 bytes long) in extended data.
1001	Registered application name (ASCII string up to 31 bytes long) for extended data.
1002	Extended data control string ("{"or "}").
1003	Extended data layer name.
1004	Chunk of bytes (up to 127 bytes long) in extended data.
1005	Entity handle in extended data. Text string of up to 16 hexadecimal digits
1010	A point in extended data  DXF: X value (followed by 1020 and 1030 groups) APP: 3D point
1020, 1030	DXF: Y and Z values of a point
1011	A 3D world space position in extended data  DXF: X value (followed by 1021 and 1031 groups) APP: 3D point
1021, 1031	DXF: Y and Z values of a World space position
1012	A 3D world space displacement in extended data DXF: X value (followed by 1022 and 1032 groups) APP: 3D vector
1022, 1032	DXF: Y and Z values of a World space displacement
1013	A 3D world space direction in extended data.  DXF: X value (followed by 1022 and 1032 groups) APP: 3D vector
1023, 1033	DXF: Y and Z values of a World space direction
1040	Extended data floating-point value.
1041	Extended data distance value.
1042	Extended data scale factor.
1070	Extended data 16-bit signed integer.
1071	Extended data 32-bit signed long.


Object and Entity Codes  [ACG]
DXF Group Codes

 General DXF Conventions

  Object and Entity Codes

In the DXF format, the definition of objects differs from entities: objects have no graphical representation and entities do. For example, dictionaries are objects not entities. Entities are also referred to as graphical objects while objects are referred to as nongraphical objects.

Entities appear in both the BLOCK and ENTITIES sections of the DXF file. The appearance of entities in the two sections is identical.

Some group codes that define an entity always appear; others are optional and appear only if their values differ from the defaults.

Programs that read DXF files should not assume that the groups describing an entity occur in the order given here. The end of an entity is indicated by the next 0 group, which begins the next entity or indicates the end of the section.

Note  Accommodating DXF files from future releases of AutoCAD will be easier if you write your DXF processing program in a table-driven way, ignore undefined group codes, and make no assumptions about the order of group codes in an entity. As AutoCAD is further enhanced, new group codes will be added to entities to accommodate additional features.


HEADER Section  [ACG]
DXF Group Codes

 HEADER Section

The group codes described in this section pertain only to DXF files.

The HEADER section of the DXF file contains settings of variables associated with the drawing. Each variable is specified in the header section by a 9 group giving the variable's name, followed by groups that supply the variable's value. Note that some variables appearing in appendix A, "System Variables," of the Command Reference do not appear in the DXF file.

Applications can retrieve the values of these variables with the getvar function.

The following is an example of the HEADER section of a DXF file:

0 SECTION   2 HEADER	Beginning of HEADER section
9 $<variable> <group code> <value>	Repeats for each header variable
0 ENDSEC	End of HEADER section
The following table lists the variables that are saved in a DXF file.

DXF system variables

Variable	Group code	Description
$ACADMAINTVER	70	Maintenance version number (should be ignored)
$ACADVER	1	The AutoCAD drawing database version number:  AC1006 = R10, AC1009 = R11 and R12, AC1012 = R13, AC1014 = R14
$ANGBASE	50	Angle 0 direction
$ANGDIR	70	1 = clockwise angles, 0 = counterclockwise
$ATTDIA	70	Attribute entry dialogs: 1 = on, 0 = off
$ATTMODE	70	Attribute visibility: 0 = none, 1 = normal, 2 = all
$ATTREQ	70	Attribute prompting during INSERT: 1 = on, 0 = off
$AUNITS	70	Units format for angles
$AUPREC	70	Units precision for angles
$BLIPMODE	70	Blip mode on if nonzero
$CECOLOR	62	Current entity color number: 0 = BYBLOCK, 256 = BYLAYER
$CELTSCALE	40	Current entity linetype scale
$CELTYPE	6	Entity linetype name, or BYBLOCK or BYLAYER
$CHAMFERA	40	First chamfer distance
$CHAMFERB	40	Second chamfer distance
$CHAMFERC	40	Chamfer length
$CHAMFERD	40	Chamfer angle
$CLAYER	8	Current layer name
$CMLJUST	70	Current multiline justification: 0=Top,1=Middle, 2=Bottom
$CMLSCALE	40	Current multiline scale
$CMLSTYLE	2	Current multiline style name
$COORDS	70	Coordinate display:  0 = static, 1 = continuous update, 2 = "d<a" format
$DELOBJ	70	Controls object deletion: 0=deleted, 1=retained
$DIMALT	70	Alternate unit dimensioning performed if nonzero
$DIMALTD	70	Alternate unit decimal places
$DIMALTF	40	Alternate unit scale factor
$DIMALTTD	70	Number of decimal places for tolerance values of an alternate units dimension
$DIMALTTZ	70	Controls suppression of zeros for alternate tolerance values:  0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet
$DIMALTU	70	Units format for alternate units of all dimension style family members except angular:  1 = Scientific; 2 = Decimal; 3 = Engineering;  4 = Architectural (stacked); 5 = Fractional (stacked); 6 = Architectural; 7 = Fractional
$DIMALTZ	70	Controls suppression of zeros for alternate unit dimension values:  0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet
$DIMAPOST	1	Alternate dimensioning suffix
$DIMASO	70	1 = create associative dimensioning, 0 = draw individual entities
$DIMASZ	40	Dimensioning arrow size
$DIMAUNIT	70	Angle format for angular dimensions:  0=Decimal degrees, 1=Degrees/minutes/seconds, 2=Gradians, 3=Radians, 4=Surveyor's units
$DIMBLK	1	Arrow block name
$DIMBLK1	1	First arrow block name
$DIMBLK2	1	Second arrow block name
$DIMCEN	40	Size of center mark/lines
$DIMCLRD	70	Dimension line color: range is 0 = BYBLOCK, 256 = BYLAYER
$DIMCLRE	70	Dimension extension line color:  range is 0 = BYBLOCK,  256 = BYLAYER
$DIMCLRT	70	Dimension text color:  range is 0 = BYBLOCK, 256 = BYLAYER
$DIMDEC	70	Number of decimal places for the tolerance values of a primary units dimension
$DIMDLE	40	Dimension line extension
$DIMDLI	40	Dimension line increment
$DIMEXE	40	Extension line extension
$DIMEXO	40	Extension line offset
$DIMFIT	70	Placement of text and arrowheads; Possible values: 0 through 3 (see appendix A, "System Variables," in the Command Reference)
$DIMGAP	40	Dimension line gap
$DIMJUST	70	Horizontal dimension text position: 0=above dimension line and center-justified between extension lines, 1=above dimension line and next to first extension line, 2=above dimension line and next to second extension line, 3=above and center-justified to first extension line, 4=above and center-justified to second extension line
$DIMLFAC	40	Linear measurements scale factor
$DIMLIM	70	Dimension limits generated if nonzero
$DIMPOST	1	General dimensioning suffix
$DIMRND	40	Rounding value for dimension distances
$DIMSAH	70	Use separate arrow blocks if nonzero
$DIMSCALE	40	Overall dimensioning scale factor
$DIMSD1	70	Suppression of first extension line: 0=not suppressed, 1=suppressed
$DIMSD2	70	Suppression of second extension line: 0=not suppressed, 1=suppressed
$DIMSE1	70	First extension line suppressed if nonzero
$DIMSE2	70	Second extension line suppressed if nonzero
$DIMSHO	70	1 = Recompute dimensions while dragging,  0 = drag original image
$DIMSOXD	70	Suppress outside-extensions dimension lines if nonzero
$DIMSTYLE	2	Dimension style name
$DIMTAD	70	Text above dimension line if nonzero
$DIMTDEC	70	Number of decimal places to display the tolerance values
$DIMTFAC	40	Dimension tolerance display scale factor
$DIMTIH	70	Text inside horizontal if nonzero
$DIMTIX	70	Force text inside extensions if nonzero
$DIMTM	40	Minus tolerance
$DIMTOFL	70	If text outside extensions, force line extensions between extensions if nonzero
$DIMTOH	70	Text outside horizontal if nonzero
$DIMTOL	70	Dimension tolerances generated if nonzero
$DIMTOLJ	70	Vertical justification for tolerance values: 0=Top, 1=Middle, 2=Bottom
$DIMTP	40	Plus tolerance
$DIMTSZ	40	Dimensioning tick size:  0 = no ticks
$DIMTVP	40	Text vertical position
$DIMTXSTY	7	Dimension text style
$DIMTXT	40	Dimensioning text height
$DIMTZIN	70	Controls suppression of zeros for tolerance values:  0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet
$DIMUNIT	70	Units format for all dimension style family members except angular:   1 = Scientific; 2 = Decimal; 3 = Engineering;  4 = Architectural (stacked); 5 = Fractional (stacked); 6 = Architectural; 7 = Fractional
$DIMUPT	70	Cursor functionality for user positioned text:  0=controls only the dimension line location, 1=controls the text position as well as the dimension line location
$DIMZIN	70	Controls suppression of zeros for primary unit values:  0 = Suppresses zero feet and precisely zero inches 1 = Includes zero feet and precisely zero inches 2 = Includes zero feet and suppresses zero inches 3 = Includes zero inches and suppresses zero feet
$DISPSILH	70	Controls the display of silhouette curves of body objects in wire-frame mode: 0=Off, 1=On
$DRAGMODE	70	0 = off, 1 = on, 2 = auto
$DWGCODEPAGE	3	Drawing code page; Set to the system code page when a new drawing is created, but not otherwise maintained by AutoCAD
$ELEVATION	40	Current elevation set by ELEV command
$EXTMAX	10, 20, 30	X, Y, and Z drawing extents upper-right corner (in WCS)
$EXTMIN	10, 20, 30	X, Y, and Z drawing extents lower-left corner (in WCS)
$FILLETRAD	40	Fillet radius
$FILLMODE	70	Fill mode on if nonzero
$HANDLING	70	Next available handle
$HANDSEED	5	Next available handle
$INSBASE	10, 20, 30	Insertion base set by BASE command (in WCS)
$LIMCHECK	70	Nonzero if limits checking is on
$LIMMAX	10, 20	XY drawing limits upper-right corner (in WCS)
$LIMMIN	10, 20	XY drawing limits lower-left corner (in WCS)
$LTSCALE	40	Global linetype scale
$LUNITS	70	Units format for coordinates and distances
$LUPREC	70	Units precision for coordinates and distances
$MAXACTVP	70	Sets maximum number of viewports to be regenerated
$MEASUREMENT	70	Sets drawing units. 0=English; 1=Metric
$MENU	1	Name of menu file
$MIRRTEXT	70	Mirror text if nonzero
$ORTHOMODE	70	Ortho mode on if nonzero
$OSMODE	70	Running object snap modes
$PDMODE	70	Point display mode
$PDSIZE	40	Point display size
$PELEVATION	40	Current paper space elevation
$PEXTMAX	10, 20, 30	Maximum X, Y, and Z extents for paper space
$PEXTMIN	10, 20, 30	Minimum X, Y, and Z extents for paper space
$PICKSTYLE	70	Controls group selection and associative hatch selection: 0=No group selection or associative hatch selection,  1=Group selection,  2 =Associative hatch selection,  3 =Group selection and associative hatch selection
$PINSBASE	10, 20, 30	Paper space insertion base point
$PLIMCHECK	70	Limits checking in paper space when nonzero
$PLIMMAX	10, 20	Maximum X and Y limits in paper space
$PLIMMIN	10, 20	Minimum X and Y limits in paper space
$PLINEGEN	70	Governs the generation of linetype patterns around the vertices of a 2D polyline: 1 = linetype is generated in a continuous pattern around vertices of the polyline,  0 = each segment of the polyline starts and ends with a dash
$PLINEWID	40	Default polyline width
$PROXYGRAPHICS	70	Controls the saving of proxy object images
$PSLTSCALE	70	Controls paper space linetype scaling: 1 = no special linetype scaling 0 = viewport scaling governs linetype scaling
$PUCSNAME	2	Current paper space UCS name
$PUCSORG	10, 20, 30	Current paper space UCS origin
$PUCSXDIR	10, 20, 30	Current paper space UCS X axis
$PUCSYDIR	10, 20, 30	Current paper space UCS Y axis
$QTEXTMODE	70	Quick text mode on if nonzero
$REGENMODE	70	REGENAUTO mode on if nonzero
$SHADEDGE	70	0 = faces shaded, edges not highlighted  1 = faces shaded, edges highlighted in black  2 = faces not filled, edges in entity color  3 = faces in entity color, edges in black
$SHADEDIF	70	Percent ambient/diffuse light, range 1-100, default 70
$SKETCHINC	40	Sketch record increment
$SKPOLY	70	0 = sketch lines, 1 = sketch polylines
$SPLFRAME	70	Spline control polygon display: 1 = on, 0 = of
$SPLINESEGS	70	Number of line segments per spline patch
$SPLINETYPE	70	Spline curve type for PEDIT Spline
$SURFTAB1	70	Number of mesh tabulations in first direction
$SURFTAB2	70	Number of mesh tabulations in second direction
$SURFTYPE	70	Surface type for PEDIT Smooth
$SURFU	70	Surface density (for PEDIT Smooth) in M direction
$SURFV	70	Surface density (for PEDIT Smooth) in N direction
$TDCREATE	40	Date/time of drawing creation
$TDINDWG	40	Cumulative editing time for this drawing
$TDUPDATE	40	Date/time of last drawing update
$TDUSRTIMER	40	User elapsed timer
$TEXTSIZE	40	Default text height
$TEXTSTYLE	7	Current text style name
$THICKNESS	40	Current thickness set by ELEV command
$TILEMODE	70	1 for previous release compatibility mode, 0 otherwise
$TRACEWID	40	Default trace width
$TREEDEPTH	70	Specifies the maximum depth of the spatial index.
$UCSNAME	2	Name of current UCS
$UCSORG	10, 20, 30	Origin of current UCS (in WCS)
$UCSXDIR	10, 20, 30	Direction of current UCS's X axis (in WCS)
$UCSYDIR	10, 20, 30	Direction of current UCS's Y axis (in WCS)
$UNITMODE	70	Low bit set = display fractions, feet-and-inches, and surveyor's angles in input format
$USERI1 - 5	70	Five integer variables intended for use by third-party developers
$USERR1 - 5	40	Five real variables intended for use by third-party developers
$USRTIMER	70	0 = timer off, 1 = timer on
$VISRETAIN	70	0 = don't retain xref-dependent visibility settings, 1 = retain  xref-dependent visibility settings
$WORLDVIEW	70	1 = set UCS to WCS during DVIEW/VPOINT, 0 = don't change UCS
The following header variables existed prior to AutoCAD Release 11 but now have independent settings for each active viewport. DXFIN honors these variables when read from DXF files, but if a VPORT symbol table with *ACTIVE entries is present (as is true for any DXF file produced by Release 11 or higher), the values in the VPORT table entries override the values of these header variables.

Revised VPORT header variables

Variable	Group code	Description
$FASTZOOM	70	Fast zoom enabled if nonzero
$GRIDMODE	70	Grid mode on if nonzero
$GRIDUNIT	10, 20	Grid X and Y spacing
$SNAPANG	50	Snap grid rotation angle
$SNAPBASE	10, 20	Snap/grid base point (in UCS)
$SNAPISOPAIR	70	Isometric plane: 0 = left, 1 = top, 2 = right
$SNAPMODE	70	Snap mode on if nonzero
$SNAPSTYLE	70	Snap style: 0 = standard, 1 = isometric
$SNAPUNIT	10, 20	Snap grid X and Y spacing
$VIEWCTR	10, 20	XY center of current view on screen
$VIEWDIR	10, 20, 30	Viewing direction (direction from target in WCS)
$VIEWSIZE	40	Height of view
The date/time variables ($TDCREATE and $TDUPDATE) are output as real numbers in the following format:

<Julian date>.<Fraction>

The elapsed time variables ($TDINDWG and $TDUSRTIMER) have a similar format:

<number of days>.<Fraction>

The date and time variables are described in the Command Reference.


CLASSES Section  [ACG]
DXF Group Codes

 CLASSES Section

The group codes described in this section are found only in DXF files.

The CLASSES section holds the information for application-defined classes whose instances appear in the BLOCKS, ENTITIES, and OBJECTS sections of the database. It is assumed that a class definition is permanently fixed in the class hierarchy. All fields are required.

The following is an example of the CLASSES section of a DXF file:

0 SECTION   2 CLASSES	Beginning of CLASSES section
0 CLASS   1 <class dxf record>   2 <class name>   3 <app name>  90 <flag> 280 <flag> 281 <flag>	Repeats for each entry
0 ENDSEC	End of CLASSES section
Each entry in the CLASSES section contains the groups described in the following table.

CLASSES section group codes

Group code	Description
0	Record type (CLASS). Identifies beginning of a CLASS record.
1	Class DXF record name. These should always be unique.
2	C++ class name. Used to bind with software that defines object class behavior. These are always unique.
3	Application name. Posted in Alert box when a class definition listed in this section is not currently loaded.
90	Proxy capabilities flag. Bit coded value that indicates the capabilities of this object as a proxy.  0 = No operations allowed (0)  1 = Erase allowed (0x1)  2 = Transform allowed (0x2)  4 = Color change allowed (0x4)  8 = Layer change allowed (0x8)  16 = Linetype change allowed (0x10) 32 = Linetype scale change allowed (0x20)  64 = Visibility change allowed (0x40) 127 = All operations except cloning allowed (0x7F)  128 = Cloning allowed (0x80) 255 = All operations allowed (0xFF)  32768 = R13 format proxy (0x8000)
280	Was-a-proxy flag. Set to 1 if class was not loaded when this DXF file was created, and 0 otherwise.
281	Is-an-entity flag. Set to 1 if class was derived from the AcDbEntity class and can reside in the BLOCKS or ENTITIES section. If 0, instances may appear only in the OBJECTS section.
AutoCAD registers the classes listed in the following table (note that this may not be a complete list of the classes found in a DXF file depending on the applications currently in use on your system).

Default class values

DXF Record Name Code 1	C++ Class Name Code 2	Code 90	Code 280	Code 281
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
LWPOLYLINE	AcDbPolyline	0	0	1
OBJECT_PTR	CAseDLPNTableRecord	1	0	0
OLE2FRAME	AcDbOle2Frame	0	0	1
RASTERVARIABLES	AcDbRasterVariables	0	0	0
SORTENTSTABLE	AcDbSortentsTable	0	0	0
SPATIAL_INDEX	AcDbSpatialIndex	0	0	0
SPATIAL_FILTER	AcDbSpatialFilter	0	0	0


TABLES Section  [ACG]
DXF Group Codes

 TABLES Section

The group codes described in this section are found in DXF files and used by applications. The TABLES section contains several tables, each of which can contain a variable number of entries. These codes are also used by AutoLISP and ARX applications in entity definition lists.

The group codes shown in this section can apply to DXF files, applications (AutoLISP or ARX), or both. When the description of a code is different for applications and DXF files (or only applies to one or the other), the description is preceeded by the following indicators:

APP   	Application-specific description

DXF   	DXF file-specific description

If the description is common to both DXF files and applications, no indicator is provided. Otherwise, the appropriate indicator is present. Optional codes are shown in gray.

Topics in this section:

   Symbol Tables in DXF Files

   Symbol Table Group Codes

   Common Group Codes for Symbol Table Entries

   APPID

   BLOCK_RECORD

   DIMSTYLE

   LAYER

   LTYPE

   STYLE

   UCS

   VIEW

   VPORT


Symbol Tables in DXF Files  [ACG]
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 SECTION   2 TABLES	Beginning of TABLES section
0 TABLE   2 <table type>   5 <handle> 100 AcDbSymbolTable  70 <max. entries>	Common table group codes, repeats for each entry
0 <table type>   5 <handle> 100 AcDbSymbolTableRecord  .  . <data>  .	Table entry data, repeats, for each table record
0 ENDTAB	End of table
0 ENDSEC	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.


Symbol Table Group Codes  [ACG]
DXF Group Codes

 TABLES Section

  Symbol Table Group Codes

The following table shows group codes that apply to all symbol tables.

Group codes that apply to all symbol tables

Group code	Description
-1	APP: entity name (changes each time a drawing is opened)
0	Object type (TABLE)
2	Table name
5	Handle
100	Subclass marker (AcDbSymbolTable)
70	Maximum number of entries in table.


Common Group Codes for Symbol Table Entries  [ACG]
DXF Group Codes

 TABLES Section

  Common Group Codes for Symbol Table Entries

The following table shows group codes that apply to all symbol table entries. Optional codes are shown in gray. When you refer to the table of group codes by entity type, which lists the codes associated with specific entities, keep in mind that the codes shown here can also be present.

Group codes that apply to all symbol table entries

Group code	Description
-1	APP: entity name (changes each time a drawing is opened)
0	Entity type (table name)
5	Handle (all except DIMSTYLE)
105	Handle (DIMSTYLE table only)
102	Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
application-defined codes	Codes and values within the 102 groups are application-defined.
102	End of group, "}"
100	Subclass marker (AcDbSymbolTableRecord)
The following table shows the group codes that are output if persistent reactors have been attached to an object.

ACAD_REACTORS records

Group code	Description
102	"{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
330	Soft pointer ID/handle to owner dictionary
102	End of group, "}"
The following table shows the group codes that are output if an extension dictionary has been attached to an object.

ACAD_XDICTIONARY records

Group code	Description
102	"{ACAD_XDICTIONARY" indicates the start of an extension dictionary group.
360	Hard-owner ID/handle to owner dictionary.
102	End of group, "}".
Common 70 group flag bit-coded values are described in the following tables. Additional 70 group values that apply to LAYER, STYLE, and VIEW table entries are described in those tables.

Group 70 bit codes that apply to all table entries

Bit-coded value	Description
16	If set, table entry is externally dependent on an xref.
32	If this bit and bit 16 are both set, the externally dependent xref has been successfully resolved.
64	If set, the table entry was referenced by at least one entity in the drawing the last time the drawing was edited. (This flag is for the benefit of AutoCAD commands. It can be ignored by most programs that read DXF files and need not be set by programs that write DXF files.)


APPID  [ACG]
DXF Group Codes

 TABLES Section

  APPID

The following group codes apply to APPID symbol table entries.

APPID group codes

Group codes	Description
100	Subclass marker (AcDbRegAppTableRecord)
2	User-supplied (or application-supplied) application name (for extended data). These table entries maintain a set of names for all registered applications.
70	Standard flag values (See "Common Group Codes for Symbol Table Entries."): 1 = If set, xdata associated with this APPID is not written when SAVEASR12 is performed.
Note   Because there was no change in the ASE data format from R13 to R14, the ASE application name (ACADASER13) did not change.


BLOCK_RECORD  [ACG]
DXF Group Codes

 TABLES Section

  BLOCK_RECORD

The following group codes apply to BLOCK_RECORD symbol table entries.

BLOCK_RECORD group codes

Group codes	Description
100	Subclass marker (AcDbBlockTableRecord)
2	Block name


DIMSTYLE  [ACG]
DXF Group Codes

 TABLES Section

  DIMSTYLE

The following group codes apply to DIMSTYLE symbol table entries. The DIMSTYLE system variables are described in appendix A, "System Variables," in the Command Reference.

DIMSTYLE group codes

Group codes	Description
100	Subclass marker (AcDbDimStyleTableRecord)
2	Dimension style name
70	Standard flag values (See "Common Group Codes for Symbol Table Entries.")
3	DIMPOST
4	DIMAPOST
5	DIMBLK
6	DIMBLK1
7	DIMBLK2
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
71	DIMTOL
72	DIMLIM
73	DIMTIH
74	DIMTOH
75	DIMSE1
76	DIMSE2
77	DIMTAD
78	DIMZIN
170	DIMALT
171	DIMALTD
172	DIMTOFL
173	DIMSAH
174	DIMTIX
175	DIMSOXD
176	DIMDLRD
177	DIMCLRE
178	DIMCLRT
270	DIMUNIT
271	DIMDEC
272	DIMTDEC
273	DIMALTU
274	DIMALTTD
340	Handle of referenced STYLE object (used instead of storing DIMTXSTY value)
275	DIMAUNIT
280	DIMJUST
281	DIMSD1
282	DIMSD2
283	DIMTOLJ
284	DIMTZIN
285	DIMALTZ
286	DIMALTTZ
287	DIMFIT
288	DIMUPT


LAYER  [ACG]
DXF Group Codes

 TABLES Section

  LAYER

The following group codes apply to LAYER symbol table entries.

LAYER group codes

Group codes	Description
100	Subclass marker (AcDbSymbolTableRecord)
2	Layer name
70	Standard flags. (See "Common Group Codes for Symbol Table Entries.") In addition to the standard flags, the following values apply to layers (bit-coded values) 1 = Layer is frozen, otherwise layer is thawed  2 = Layer is frozen by default in new viewports 4 = Layer is locked
62	Color number (if negative, layer is Off)
6	Linetype name
Xref-dependent layers are output during DXFOUT. For these layers, the associated linetype name in the DXF file is always CONTINUOUS.


LTYPE  [ACG]
DXF Group Codes

 TABLES Section

  LTYPE

The following group codes apply to LTYPE symbol table entries.

LTYPE group codes

Group codes	Description
100	Subclass marker (AcDbLinetypeTableRecord)
2	Linetype name.
70	Standard flags. (See "Common Group Codes for Symbol Table Entries.")
3	Descriptive text for linetype.
72	Alignment code; value is always 65, the ASCII code for A.
73	The number of linetype elements.
40	Total pattern length.
49	Dash, dot or space length (one entry per element).
74	Complex linetype element type (one per element). Default is 0 (no embedded shape/text). The following codes are bit values: 1 = if set, code 50 specifies an absolute rotation, if not set, code 50 specifies a relative rotation; 2 = embedded element is a text string; 4 = embedded element is a shape
75	Shape number (one per element) if code 74 specifies an embeded shape. If code 74 specifies an embeded text string, this value is set to 0. If code 74 is set to 0, code 75 is omitted.
340	Pointer to STYLE object (one per element if code 74 > 0)
46	S= scale value (optional). Multiple entries can exist.
50	R= (relative) or A= (absolute) rotation value in radians of embedded shape or text. One per element if code 74 specifies an embeded shape or text string.
44	X= x offset value (optional). Multiple entries can exist.
45	Y= y offset value (optional). Multiple entries can exist.
9	Text string (one per element if code 74 = 2)
The group codes 74, 75, 340, 46, 50, 44, 45, and 9 are not returned by the tblsearch or tblnext functions. You must use tblobjname to retrieve these values within an application.


STYLE  [ACG]
DXF Group Codes

 TABLES Section

  STYLE

The following group codes apply to STYLE symbol table entries.

STYLE group codes

Group codes	Description
100	Subclass marker (AcDbTextStyleTableRecord)
2	Style name
70	Standard flag values (bit-coded values) (See "Common Group Codes for Symbol Table Entries.") 1=if set, this entry describes a shape  4=Vertical text
40	Fixed text height; 0 if not fixed
41	Width factor
50	Oblique angle
71	Text generation flags 2=Text is backward (mirrored in X) 4=Text is upside down (mirrored in Y)
42	Last height used
3	Primary font file name
4	Bigfont file name; blank if none
A STYLE table item is also used to record shape file LOAD command requests. In this case the first bit (1) is set in the 70 group flags and only the 3 group (shape file name) is meaningful (all the other groups are output, however).


UCS  [ACG]
DXF Group Codes

 TABLES Section

  UCS

The following group codes apply to UCS symbol table entries.

UCS group codes

Group codes	Description
100	Subclass marker (AcDbUCSTableRecord)
2	UCS name
70	Standard flag values (See "Common Group Codes for Symbol Table Entries.")
10	Origin (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of origin (in WCS)
11	X-axis direction (in WCS). DXF: X value; APP: 3D vector
21, 31	DXF: Y and Z values of X-axis direction (in WCS)
12	Y-axis direction (in WCS). DXF: X value; APP: 3D vector
22, 32	DXF: Y and Z values of Y-axis direction (in WCS)


VIEW  [ACG]
DXF Group Codes

 TABLES Section

  VIEW

The following group codes apply to VIEW symbol table entries.

VIEW group codes

Group codes	Description
100	Subclass marker (AcDbViewTableRecord)
2	Name of view
70	Standard flag values (bit-coded values) (See "Common Group Codes for Symbol Table Entries.") 1 = if set, this is a paper space view
40	View height (in DCS)
10	View center point (in DCS). DXF: X value; APP: 2D point
20	DXF: Y value of view center point (in DCS)
41	View width (in DCS)
11	View direction from target (in WCS) DXF: X value; APP: 3D vector
21, 31	DXF: Y and Z values of view direction from target (in WCS)
12	Target point (in WCS). DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of target point (in WCS)
42	Lens length
43	Front clipping plane (offset from target point)
44	Back clipping plane (offset from target point)
50	Twist angle
71	View mode (see VIEWMODE system variable)


VPORT  [ACG]
DXF Group Codes

 TABLES Section

  VPORT

The following group codes apply to VPORT symbol table entries.

VPORT group codes

Group codes	Description
100	Subclass marker (AcDbViewportTableRecord)
2	Viewport name
70	Standard flag values (See "Common Group Codes for Symbol Table Entries.")
10	Lower-left corner of viewport.  DXF: X value; APP: 2D point
20	DXF: Y value of lower-left corner of viewport
11	Upper-right corner of viewport  DXF: X value; APP: 2D point
21	DXF: Y value of upper-right corner of viewport
12	View center point (in DCS). DXF: X value; APP: 2D point
22	DXF: Y value of view center point (in DCS)
13	Snap base point. DXF: X value; APP: 2D point
23	DXF: Y value of snap base point
14	Snap spacing X and Y. DXF: X value; APP: 2D point
24	DXF: Y value of snap spacing X and Y
15	Grid spacing X and Y. DXF: X value; APP: 2D point
25	DXF: Y value of grid spacing X and Y
16	View direction from target point (in WCS)  DXF: X value; APP: 3D point
26, 36	DXF: Y and Z values of view direction from target point  (in WCS)
17	View target point (in WCS). DXF: X value; APP: 3D point
27, 37	DXF: Y and Z values of view target point (in WCS)
40	View height
41	Viewport aspect ratio
42	Lens length
43	Front clipping plane (offset from target point)
44	Back clipping plane (offset from target point)
50	Snap rotation angle
51	View twist angle
68	APP: Status field (never saved in DXF)
69	APP: ID (never saved in DXF)
71	View mode (see VIEWMODE system variable)
72	Circle zoom percent
73	Fast zoom setting
74	UCSICON setting
75	Snap on/off
76	Grid on/off
77	Snap style
78	Snap isopair
The VPORT table is unique: it may contain several entries with the same name (indicating a multiple-viewport configuration). The entries corresponding to the active viewport configuration all have the name *ACTIVE. The first such entry describes the current viewport.


BLOCKS Section  [ACG]
DXF Group Codes

 BLOCKS Section

The group codes described in this section are found in DXF files and used by applications. The BLOCKS section contains an entry for each block reference in the drawing.

The group codes shown in this section can apply to DXF files, applications (AutoLISP or ARX), or both. When the description of a code is different for applications and DXF files (or only applies to one or the other), the description is preceeded by the following indicators:

APP   	Application-specific description

DXF   	DXF file-specific description

If the description is common to both DXF files and applications, no indicator is provided. Otherwise, the appropriate indicator is present. Optional codes are shown in gray.

Topics in this section:

   Blocks in DXF Files

   BLOCK

   ENDBLK


Blocks in DXF Files  [ACG]
DXF Group Codes

 BLOCKS Section

  Blocks in DXF Files

The BLOCKS section of the DXF file contains all the block definitions. It contains the entities that make up the blocks used in the drawing, including anonymous blocks generated by the HATCH command and by associative dimensioning. The format of the entities in this section is identical to those in the ENTITIES section. All entities in the BLOCKS section appear between block and endblk entities. Block and endblk entities appear only in the BLOCKS section. Block definitions are never nested (that is, no block or endblk entity ever appears within another block-endblk pair), although a block definition can contain an insert entity.

External references are written in the DXF file as block definitions, except that they also include a string (group code 1) that specifies the path and file name of the external reference.

The block table handle, along with any xdata and persistent reactors, appears in each block definition immediately following the BLOCK record, which contains all of the specific information that a block table record stores. Therefore, each block definition has the following sequence of records:

The following is an example of the BLOCKS section of a DXF file:

0 SECTION   2 BLOCKS	Beginning of BLOCKS section
0 BLOCK   5 <handle> 100 AcDbEntity   8 <layer> 100 AcDbBlockBegin   2 <block name>  70 <flag>  10 <X value>  20 <Y value>  30 <Z value>   3 <block name>   1 <xref path>	Begins each block entry   (a block entity definition)
0 <entity type>  .  . <data>  .	One entry for each entity definition within the block
0 ENDBLK   5 <handle> 100 AcDbBlockEnd	End of each block entry  (an endblk entity definition)
0 ENDSEC	End of BLOCKS section


BLOCK  [ACG]
DXF Group Codes

 BLOCKS Section

  BLOCK

The following group codes apply to block entities.

Block group codes

Group codes	Description
0	Entity type (BLOCK)
5	Handle
102	Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
application-defined codes	Codes and values within the 102 groups are application-defined.
102	End of group, "}"
100	Subclass marker (AcDbEntity)
8	Layer name
100	Subclass marker (AcDbBlockBegin)
2	Block name
70	Block-type flags (bit coded values, may be combined):  1 = This is an anonymous block generated by hatching, associative dimensioning, other internal operations, or an application  2 = This block has attribute definitions  4 = This block is an external reference (xref)  8 = This block is an xref overlay  16 = This block is externally dependent 32 = This is a resolved external reference, or dependent of an external reference (ignored on input) 64 = This definition is a referenced external reference (ignored on input)
10	Base point. DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of base point
3	Block name
1	Xref path name (optional; present only if the block is an xref)
The UCS in effect when a block definition is created becomes the WCS for all entities in the block definition. The new origin for these entities is shifted to match the base point defined for the block definition. All entity data is translated to fit this new WCS.

*MODEL_SPACE and *PAPER_SPACE Block Definition

Now, there are always two extra, empty definitions in the BLOCKS section, titled *MODEL_SPACE and *PAPER_SPACE. These definitions manifest the new representation of model space and paper space as block definitions internally. The entities contained in these definitions still appear in the ENTITIES section for compatibility.

Model Space and Paper Space Entity Segregation

The interleaving between model space and paper space will no longer occurs, because of internal organization. Instead, all paper space entities are output, followed by model space entities. The flag distinguishing them is the group code 67.


ENDBLK  [ACG]
DXF Group Codes

 BLOCKS Section

  ENDBLK

The following group codes apply to endblk objects.

Endblk group codes

Group codes	Description
0	Entity type (ENDBLK)
5	Handle
102	Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
application-defined codes	Codes and values within the 102 groups are application-defined.
102	End of group, "}"
100	Subclass marker (AcDbBlockEnd)


ENTITIES Section  [ACG]
DXF Group Codes

 ENTITIES Section

This section presents the group codes that apply to graphical objects. These codes are found in the ENTITIES section of a DXF file and are used by AutoLISP and ARX applications in entity definition lists.

The group codes shown in this section can apply to DXF files, applications (AutoLISP or ARX), or both. When the description of a code is different for applications and DXF files (or only applies to one or the other), the description is preceeded by the following indicators:

APP   	Application-specific description

DXF   	DXF file-specific description

If the description is common to both DXF files and applications, no indicator is provided. Otherwise, the appropriate indicator is present. Optional codes are shown in gray.

Topics in this section:

   Common Group Codes for Graphical Objects

   3DFACE

   3DSOLID

   ACAD_PROXY_ENTITY

   ARC

   ATTDEF

   ATTRIB

   BODY

   CIRCLE

   DIMENSION

   ELLIPSE

   HATCH

   IMAGE

   INSERT

   LEADER

   LINE

   LWPOLYLINE

   MLINE

   MTEXT

   OLEFRAME

   OLE2FRAME

   POINT

   POLYLINE

   RAY

   REGION

   SEQEND

   SHAPE

   SOLID

   SPLINE

   TEXT

   TOLERANCE

   TRACE

   VERTEX

   VIEWPORT

   XLINE


Common Group Codes for Graphical Objects  [ACG]
DXF Group Codes

 ENTITIES Section

  Common Group Codes for Graphical Objects

The following table shows group codes that apply to virtually all graphical objects. Some of the group codes shown here are included with an entity definition only if the entity has nondefault values for the property. When you refer to the group codes by entity type, which lists the codes associated with specific entities, keep in mind that the codes shown here are also present.

When a group is omitted, its default value upon input (when using DXFIN) is indicated in the third column. If the value of a group code is equal to the default, it is omitted upon output (when using DXFOUT).

Group codes that apply to all graphical objects

Group code	Description	If omitted, defaults to...
-1	APP: entity name (changes each time  a drawing is opened)	Not omitted
0	Entity type	Not omitted
5	Handle	Not omitted
102	Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start  of the AutoCAD persistent reactors group	no default
application-defined codes	Codes and values within the 102 groups are application-defined.	no default
102	End of group, "}"	no default
100	Subclass marker (AcDbEntity)	Not omitted
67	Absent or zero indicates entity is in model space. One indicates entity is in paper space. (optional)	0
8	Layer name	Not omitted
6	Linetype name (present if not BYLAYER).  The special name BYBLOCK indicates a  floating linetype. (optional)	BYLAYER
62	Color number (present if not BYLAYER). Zero indicates the BYBLOCK (floating) color. 256 indicates BYLAYER. A negative value indicates that the layer is turned off. (optional)	BYLAYER
48	Linetype scale (optional)	1.0
60	Object visibility (optional):  0 = visible, 1 = invisible.	0
The following table shows the group codes that are output if persistent reactors have been attached to an entity.

ACAD_REACTORS records

Group code	Description
102	"{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
330	Soft pointer ID/handle to owner dictionary
102	End of group, "}"
The following table shows the group codes that are output if an extension dictionary has been attached to an entity.

ACAD_XDICTIONARY records

Group code	Description
102	"{ACAD_XDICTIONARY" indicates the start of an extension dictionary group
360	Hard owner ID/handle to owner dictionary
102	End of group, "}"
Note  Do not write programs that rely on the order shown in these DXF code tables. Although these tables show the order of group codes as they usually appear, the order can change under certain conditions or in a future AutoCAD release. The code that controls an entity should be driven by a case (switch) or a table so that it can process each group correctly even if the order is unexpected.


3DFACE  [ACG]
DXF Group Codes

 ENTITIES Section

  3DFACE

The following group codes apply to 3dface entities.

3dface group codes

Group codes	Description
100	Subclass marker (AcDbFace)
10	First corner (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of first corner (in WCS)
11	Second corner (in WCS). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of second corner (in WCS)
12	Third corner (in WCS). DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of third corner (in WCS)
13	Fourth corner (in WCS). If only three corners are entered, this is the same as the third corner DXF: X value; APP: 3D point
23, 33	DXF: Y and Z values of fourth corner (in WCS)
70	Invisible edge flags (optional; default = 0): 1 = First edge is invisible. 2 = Second edge is invisible. 4 = Third edge is invisible. 8 = Fourth edge is invisible.


3DSOLID  [ACG]
DXF Group Codes

 ENTITIES Section

  3DSOLID

The following group codes apply to 3dsolid entities.

3dsolid group codes

Group codes	Description
100	Subclass marker (AcDbModelerGeometry)
70	Modeler format version number (currently = 1)
1	Proprietary data (multiple lines < 255 characters each)
3	Additional lines of proprietary data (if previous group 1 string is greater than 255 characters)


ACAD_PROXY_ENTITY  [ACG]
DXF Group Codes

 ENTITIES Section

  ACAD_PROXY_ENTITY

The following group codes apply to proxy entities.

Acad_proxy_entity group codes

Group codes	Description
100	DXF: AcDbProxyEntity
90	DXF: Proxy entity class ID (always 498)
91	DXF: Application entity's class ID. Class IDs are based on the order of the class in the CLASSES section. The first class is given the ID of 500, the next is 501, and so on.
92	DXF: Size of graphics data in bytes
310	DXF: Binary graphics data (multiple entries can appear)
93	DXF: Size of entity data in bits
310	DXF: Binary entity data (multiple entries can appear)
330 or 340 or 350 or 360	DXF: An object ID (multiple entries can appear)
94	DXF: 0 (indicates end of object ID section)


ARC  [ACG]
DXF Group Codes

 ENTITIES Section

  ARC

The following group codes apply to arc entities.

Arc group codes

Group codes	Description
100	Subclass marker (AcDbCircle)
39	Thickness (optional; default = 0)
10	Center point (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of center point (in OCS)
40	Radius
100	Subclass marker (AcDbArc)
50	Start angle
51	End angle
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


ATTDEF  [ACG]
DXF Group Codes

 ENTITIES Section

  ATTDEF

The following group codes apply to attdef (attribute definition) entities.

Attdef group codes

Group codes	Description
100	Subclass marker (AcDbText)
39	Thickness (optional; default = 0)
10	First alignment point (in OCS).  DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of text start point (in OCS)
40	Text height
1	Default value (string)
100	Subclass marker (AcDbAttributeDefinition)
50	Text rotation (optional; default = 0)
41	Relative X scale factor (width) (optional; default = 1) This value is also adjusted when fit-type text is used.
51	Oblique angle (optional; default = 0)
7	Text style name (optional, default = STANDARD)
71	Text generation flags (optional, default = 0). See TEXT
72	Horizontal text justification type (optional, default = 0). See TEXT
11	Second alignment point (in OCS).  DXF: X value; APP: 3D point  Meaningful only if 72 or 74 group values are nonzero
21, 31	DXF: Y and Z values of second alignment point (in OCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
100	Subclass marker (AcDbAttributeDefinition)
3	Prompt string
2	Tag string
70	Attribute flags 1 = Attribute is invisible (does not appear). 2 = This is a constant attribute. 4 = Verification is required on input of this attribute. 8 = Attribute is preset (no prompt during insertion).
73	Field length (optional; default = 0) (not currently used)
74	Vertical text justification type (optional, default = 0). See group code 73 in TEXT
If group 72 and/or 74 values are nonzero then the first alignment point values are ignored and AutoCAD calculates new values based on the second alignment point and the length and height of the text string itself (after applying the text style). If the 72 and 74 values are zero or missing, then the second alignment point is meaningless.


ATTRIB  [ACG]
DXF Group Codes

 ENTITIES Section

  ATTRIB

The following group codes apply to attrib (attribute) entities.

Attrib group codes

Group codes	Description
100	Subclass marker (AcDbText)
39	Thickness (optional; default = 0)
10	Text start point (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of text start point (in OCS)
40	Text height
1	Default value (string)
100	Subclass marker (AcDbAttribute)
2	Attribute tag (string)
70	Attribute flags 1 = Attribute is invisible (does not appear). 2 = This is a constant attribute. 4 = Verification is required on input of this attribute. 8 = Attribute is preset (no prompt during insertion).
73	Field length (optional; default = 0) (not currently used)
50	Text rotation (optional; default = 0)
41	Relative X scale factor (width) (optional; default = 1). This value is also adjusted when fit-type text is used.
51	Oblique angle (optional; default = 0)
7	Text style name (optional, default = STANDARD)
71	Text generation flags (optional, default = 0). See TEXT
72	Horizontal text justification type (optional, default = 0). See TEXT.
74	Vertical text justification type (optional, default = 0). See group code 73 in TEXT.
11	Alignment point (in OCS). DXF: X value; APP: 3D point. Present only if 72 or 74 group is present and nonzero.
21, 31	DXF: Y and Z values of alignment point (in OCS)
210	Extrusion direction. Present only if the entity's extrusion direction is not parallel to the WCS Z axis (optional; default = 0, 0, 1). DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
If group 72 and/or 74 values are nonzero then the text insertion point values are ignored, and AutoCAD calculates new values based on the text alignment point and the length of the text string itself (after applying the text style). If the 72 and 74 values are zero or missing, then the text alignment point is ignored and recalculated based on the text insertion point and the length of the text string itself (after applying the text style).


BODY  [ACG]
DXF Group Codes

 ENTITIES Section

  BODY

The following group codes apply to body entities.

Body group codes

Group codes	Description
100	Subclass marker (AcDbModelerGeometry)
70	Modeler format version number (currently = 1)
1	Proprietary data (multiple lines < 255 characters each)
3	Additional lines of proprietary data (if previous group 1 string is greater than 255 characters)


CIRCLE  [ACG]
DXF Group Codes

 ENTITIES Section

  CIRCLE

The following group codes apply to circle entities.

Circle group codes

Group codes	Description
100	Subclass marker (AcDbCircle)
39	Thickness (optional; default = 0)
10	Center point (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of center point (in OCS)
40	Radius
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


DIMENSION  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

Dimension entity definitions consist of group codes that are common to all dimension types, followed by codes specific to the type.

Topics in this section:

   Common Dimension Group Codes

   Aligned, Linear, and Rotated Dimension Group Codes

   Linear and Rotated Dimension Group Codes

   Radial and Diameter Dimension Group Codes

   Angular Dimension Group Codes

   Ordinate Dimension Group Codes

   Dimension Style Overrides


Common Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Common Dimension Group Codes

The following group codes apply to all dimension entity types.

Common dimension group codes

Group codes	Description
100	Subclass marker (AcDbDimension)
2	Name of the block that contains the entities that make up the dimension picture
10	Definition point (in WCS). DXF: X value; APP: 3D point.
20, 30	DXF: Y and Z values of definition point (in WCS)
11	Middle point of dimension text. (in OCS). DXF: X value; APP: 3D point.
21, 31	DXF: Y and Z values of middle point of dimension text. (in OCS)
70	Dimension type.  Values 0 - 6 are integer values which represent the dimension type. Values 32, 64, and 128 are bit values, which are added to the integer values (value 32 is always set in R13 and later releases). 0 = Rotated, horizontal, or vertical; 1 = Aligned 2 = Angular; 3 = Diameter; 4 = Radius;  5 = Angular 3 point; 6 = Ordinate 32 = Indicates that the block reference (group code 2) is referenced by this dimension only. 64 = Ordinate type. This is a bit value (bit 7) used only with integer value 6. If set, ordinate is X-type; if not set, ordinate is Y-type.  128 = This is a bit value (bit 8) added to the other group 70 values if the dimension text has been positioned at a user-defined location rather than at the default location.
1	Dimension text explicitly entered by the user. Optional; default is the measurement. If null or "<>", the dimension measurement is drawn as the text, if " " (one blank space), the text is suppressed. Anything else is drawn as the text.
53	The optional group code 53 is the rotation angle of the dimension text away from its default orientation (the direction of the dimension line).
51	All dimension types have an optional 51 group code, which indicates the horizontal direction for the dimension entity. It determines the orientation of dimension text and lines for horizontal, vertical, and rotated linear dimensions.  This group value is the negative of the angle between the OCS X axis and the UCS X axis. It is always in the XY plane of the OCS.
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
3	Dimension style name
Xdata belonging to the application ID "ACAD" may follow a dimension entity. This describes any dimension overrides that have been applied to this entity. See "Dimension Style Overrides."

For all dimension types, the following group codes represent 3D WCS points: (10, 20, 30), (13, 23, 33), (14, 24, 34), and (15, 25, 35). For all dimension types, the following group codes represent 3D OCS points: (11, 21, 31), (12, 22, 32), and (16, 26, 36).


Aligned, Linear, and Rotated Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Aligned, Linear, and Rotated Dimension Group Codes

The following group codes apply to aligned, linear, and rotated dimensions.

Aligned, linear, and rotated dimension group codes

Group codes	Description
100	Subclass marker (AcDbAlignedDimension)
12	Insertion point for clones of a dimension--Baseline and Continue (in OCS). DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of insertion point for clones of a dimension--Baseline and Continue (in OCS).
13	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point
23, 33	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).
14	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point
24, 34	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).

The point (13,23,33) specifies the start point of the first extension line and the point (14,24,34) specifies the start point of the second extension line. Point (10,20,30) specifies the dimension line location. The point (11,21,31) specifies the midpoint of the dimension text.


Linear and Rotated Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Linear and Rotated Dimension Group Codes

The following group codes apply to linear and rotated dimensions.

Linear and rotated dimension group codes

Group codes	Description
50	Angle of rotated, horizontal, or vertical dimensions.
52	Linear dimension types with an oblique angle have an optional group code 52. When added to the rotation angle of the linear dimension (group code 50), it gives the angle of the extension lines.
100	Subclass marker (AcDbRotatedDimension)


Radial and Diameter Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Radial and Diameter Dimension Group Codes

The following group codes apply to radial and diameter dimensions.

Radial and diameter dimension group codes

Group codes	Description
100	Subclass marker (AcDbRadialDimension or  AcDbDiametricDimension)
15	Definition point for diameter, radius, and angular dimensions (in WCS). DXF: X value; APP: 3D point
25, 35	DXF: Y and Z values of definition point for diameter, radius, and angular dimensions (in WCS).
40	Leader length for radius and diameter dimensions.

The point (15,25,35) specifies the first point of the dimension line on the circle/arc and the point (10,20,30) specifies the point opposite the first point. The point (11,21,31) specifies the midpoint of the dimension text.

The point (15,25,35) specifies the first point of the dimension line on the circle/arc and the point (10,20,30) specifies the center of the circle/arc. The point (11,21,31) specifies the midpoint of the dimension text.


Angular Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Angular Dimension Group Codes

The following group codes apply to angular dimensions.

Angular dimension group codes

Group codes	Description
100	Subclass marker (AcDb3PointAngularDimension)
13	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point
23, 33	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).
14	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point
24, 34	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).
15	Definition point for diameter, radius, and angular dimensions (in WCS). DXF: X value; APP: 3D point
25, 35	DXF: Y and Z values of definition point for diameter, radius, and angular dimensions (in WCS).
16	Point defining dimension arc for angular dimensions. (in OCS). DXF: X value; APP: 3D point
26, 36	DXF: Y and Z values of point defining dimension arc for angular dimensions (in OCS).

The points (13,23,33) and (14,24,34) specify the endpoints of the line used to determine the first extension line and points (10,20,30) and (15,25,35) specify the endpoints of the line used to determine the second extension line. Point (16,26,36) specifies the location of the dimension line arc. The point (11,21,31) specifies the midpoint of the dimension text.

The point (15,25,35) specifies the vertex of the angle. The points (13,23,33) and (14,24,34) specify the endpoints of the extension lines. The point (10,20,30) specifies the location of the dimension line arc and the point (11,21,31) specifies the midpoint of the dimension text.


Ordinate Dimension Group Codes  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Ordinate Dimension Group Codes

The following group codes apply to ordinate dimensions.

Ordinate dimension group codes

Group codes	Description
100	Subclass marker (AcDbOrdinateDimension)
13	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point.
23, 33	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).
14	Definition point for linear and angular dimensions (in WCS). DXF: X value; APP: 3D point.
24, 34	DXF: Y and Z values of definition point for linear and angular dimensions (in WCS).

The point (13,23,33) specifies the feature location and the point (14,24,34) specifies the leader end point. The point (11,21,31) specifies the midpoint of the dimension text. Point (10,20,30) is placed at the origin of the UCS that is current when the dimension is created.


Dimension Style Overrides  [ACG]
DXF Group Codes

 ENTITIES Section

  DIMENSION

   Dimension Style Overrides

Dimension style overrides can be applied to dimension, leader, and tolerance entities. Any overrides applied to these entities are stored in the entity as xdata. The overridden dimension variable group codes and the related values are contained within group 1002 control strings. The following example shows the xdata of a dimension entity where the DIMTOL and DIMCLRE variables have been overridden.

(setq diment (car (entsel)))          ; Select dimension entity

(setq elst (entget diment '("ACAD"))) ; Get entity definition list

(assoc -3 elst)                       ; Extract xdata only

This code returns the following:

(-3 ("ACAD"                         Start of the ACAD APPID section of xdata

  (1000 . "DSTYLE") (1002 . "{")    Beginning of the dimstyle subsection

  (1070 . 177) (1070 . 3)           The DIMCLRE (code 177) override + value (3)

  (1070 . 71) (1070 . 1)            The DIMTOL (code 71) override + value (1)

  (1002 . "}") ))                   End dimstyle subsection and ACAD section


ELLIPSE  [ACG]
DXF Group Codes

 ENTITIES Section

  ELLIPSE

The following group codes apply to ellipse entities.

Ellipse group codes

Group codes	Description
100	Subclass marker (AcDbEllipse)
10	Center point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of center point (in WCS)
11	Endpoint of major axis, relative to the center (in WCS). DXF: X value; APP: 3D point.
21, 31	DXF: Y and Z values of endpoint of major axis, relative to the center (in WCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
40	Ratio of minor axis to major axis
41	Start parameter (this value is 0.0 for a full ellipse)
42	End parameter (this value is 2pi for a full ellipse)
The group codes 41 and 42 are the start and end values for u in the equation below. The magnitude of the codes 11,21,31 vector is equal to 1/2 of the major axis which is the a value in the equation. The point 10,20,30 is the c value in the equation. Knowing all these, we can calculate the b value to complete the equation.

Explanation of the ELLIPSE Command's Parameter Option

The Parameter option of the ELLIPSE command, uses the following equation to define an elliptical arc.

p(u)=c+a*cos(u)+b*sin(u)

The variables a, b, c are determined when you select the endpoints for the first axis and the distance for the second axis. a is the negative of 1/2 of the major axis length, b is the negative of 1/2 the minor axis length, and c is the center point (2-D) of the ellipse.

Because this is actually a vector equation and the variable c is actually a point with X and Y values, it really should be written as:

p(u)=(Cx+a*cos(u))*i+(Cy+b*sin(u))*j

where

Cx is the X value of the point c

Cy is the Y value of the point c

a is -(1/2 of the major axis length)

b is -(1/2 of the minor axis length)

i and j represent unit vectors in the X and Y directions

In AutoCAD, once the axis endpoints are selected all you have left to specify is the start and end of the elliptical arc.

When you select the parameter option you are asked for a start parameter and an end parameter. These values are plugged into the equation to determine the actual start and end points on the ellipse. The rest of the ellipse is filled in between these two points in a counterclockwise direction from the first parameter to the second. The value entered for the parameter u is taken to be degrees for the purposes of obtaining the cos(u) and sin(u).

For example:

Axis endpoint 1 = 0,1

Axis endpoint 2 = 4,1

Other axis distance = 2,0

Start parameter = 270

End parameter = 0

will generate the start point at 2,2 and the end point at 0,1 and fill in the ellipse from 2,2 to 0,1 in a CCW direction.


HATCH  [ACG]
DXF Group Codes

 ENTITIES Section

  HATCH

The following group codes apply to hatch entities.

Hatch group codes

Group codes	Description
100	Subclass marker (AcDbHatch)
10	Elevation point (in OCS). DXF: X value = 0; APP: 3D point (X and Y always equal 0, Z represents the elevation)
20, 30	DXF: Y and Z values of elevation point (in OCS).  Y value = 0, Z represents the elevation.
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
2	Hatch pattern name
70	Solid fill flag (solid fill = 1; pattern fill = 0)
71	Associativity flag (associative = 1; non-associative = 0)
91	Number of boundary paths (loops)
varies	Boundary path data. Repeats number of times specified by code 91. See "Boundary Path Data.".
75	Hatch style 0 = hatch "odd parity" area (Normal style) 1 = hatch outermost area only (Outer style) 2 = hatch through entire area (Ignore style)
76	Hatch pattern type 0 = user-defined 1 = predefined 2 = custom
52	Hatch pattern angle (pattern fill only)
41	Hatch pattern scale or spacing (pattern fill only)
77	Hatch pattern double flag (double = 1, not double = 0).  (pattern fill only)
78	Number of pattern definition lines
varies	Pattern line data. Repeats number of times specified by code 78. See "Pattern Data."
47	Pixel size
98	Number of seed points.
10	Seed point (in OCS). DXF: X value; APP: 2D point (multiple entries)
20	DXF: Y value of seed point (in OCS). (multiple entries)
Topics in this section:

   Boundary Path Data

   Pattern Data


Boundary Path Data  [ACG]
DXF Group Codes

 ENTITIES Section

  HATCH

   Boundary Path Data

The boundary of each hatch object is defined by a path (or loop) that consists of one or more segments. Path segment data varies depending on the entity type (or types) that make up the path. Each path segment is defined by its own set of group codes.

Hatch boundary path data group codes

Group codes	Description
92	Boundary path type flag (bit coded) 0 = default 1 = external 2 = polyline 4= derived 8 = textbox 16 = outermost
varies	Polyline boundary type data (only if boundary = polyline) See Polyline boundary data table below.
93	Number of edges in this boundary path (only if boundary is not a polyline)
72	Edge type (only if boundary is not a polyline) 1 = line 2 = circular arc 3 = elliptic arc 4 = spline
varies	Edge type data (only if boundary is not a polyline). See appropriate Edge data table below.
97	Number of source boundary objects
330	Reference to source boundary objects (multiple entries)
Polyline boundary data group codes

Group codes	Description
72	Has bulge flag
73	Is closed flag
93	Number of polyline vertices
10	Vertex location (in OCS). DXF: X value; APP: 2D point (multiple entries)
20	DXF: Y value of vertex location (in OCS). (multiple entries)
42	Bulge (optional, default = 0)
Line edge data group codes

Group codes	Description
10	Start point (in OCS). DXF: X value; APP: 2D point
20	DXF: Y value of start point (in OCS).
11	End point (in OCS). DXF: X value; APP: 2D point
21	DXF: Y value of end point (in OCS).
Arc edge data group codes

Group codes	Description
10	Center point (in OCS). DXF: X value; APP: 2D point
20	DXF: Y value of center point (in OCS).
40	Radius
50	Start angle
51	End angle
73	Is counterclockwise flag
Ellipse edge data group codes

Group codes	Description
10	Center point (in OCS). DXF: X value; APP: 2D point
20	DXF: Y value of center point (in OCS).
11	End point of major axis relative to center point (in OCS). DXF: X value; APP: 2D point
21	DXF: Y value of end point of major axis (in OCS).
40	Length of minor axis (percentage of major axis length)
50	Start angle
51	End angle
73	Is counterclockwise flag
Spline edge data group codes

Group codes	Description
94	Degree
73	Rational
74	Periodic
95	Number of knots
96	Number of control points
40	Knot values (multiple entries)
10	Control point (in OCS). DXF: X value; APP: 2D point
20	DXF: Y value of control point (in OCS).
42	Weights (optional, default = 1)


Pattern Data  [ACG]
DXF Group Codes

 ENTITIES Section

  HATCH

   Pattern Data

The following pattern data codes repeat for each pattern definition line.

Hatch pattern data group codes

Group codes	Description
53	Pattern line angle
43	Pattern line base point, X component
44	Pattern line base point, Y component
45	Pattern line offset, X component
46	Pattern line offset, Y component
79	Number of dash length items
49	Dash length (multiple entries)


IMAGE  [ACG]
DXF Group Codes

 ENTITIES Section

  IMAGE

The following group codes apply to image entities.

Image group codes

Group codes	Description
100	Subclass marker (AcDbRasterImage)
90	Class version
10	Insertion point (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of insertion point (in OCS)
11	U-vector of a single pixel  (points along the visual bottom of the image, starting at the insertion point)  (in OCS). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values U-vector (in OCS)
12	V-vector of a single pixel  (points along the visual left side of the image, starting at the insertion point)  (in OCS). DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of V-vector (in OCS)
13	Image size in pixels. DXF: U value; APP: 2D point (U and V values)
23	DXF: V value of image size in pixels
340	Hard reference to imagedef object
70	Image display properties 1 = Show image 2 = Show image when not aligned with screen 4 = Use clipping boundary 8 = Transparency is on
280	Clipping state: 0=off, 1=on
281	Brightness value (0 - 100; default = 50)
282	Contrast value (0 - 100; default = 50)
283	Fade value (0 - 100; default = 0)
360	Hard reference to imagedef_reactor object
71	Clipping boundary type. 1 = rectangular, 2 = polygonal
91	Number of clip boundary vertices that follow
14	Clip boundary vertex (in OCS). DXF: X value; APP: 2D point (multiple entries) Notes:  1) For rectangular clip boundary type, two opposite corners must be specified. Default is (-0.5,-0.5), (size.x-0.5, size.y-0.5). 2) For polygonal clip boundary type, three or more vertices must be specified. Polygonal vertices must be listed sequentially.
24	DXF: Y value of clip boundary vertex (in OCS) (multiple entries)


INSERT  [ACG]
DXF Group Codes

 ENTITIES Section

  INSERT

The following group codes apply to insert (block reference) entities.

Insert group codes

Group codes	Description
100	Subclass marker (AcDbBlockReference)
66	Variable attributes-follow flag (optional; default = 0); if the value of attributes-follow flag is 1, a series of attribute entities is expected to follow the insert, terminated by a seqend entity.
2	Block name
10	Insertion point (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of insertion point (in OCS)
41	X scale factor (optional; default = 1)
42	Y scale factor (optional; default = 1)
43	Z scale factor (optional; default = 1)
50	Rotation angle (optional; default = 0)
70	Column count (optional; default = 1)
71	Row count (optional; default = 1)
44	Column spacing (optional; default = 0)
45	Row spacing (optional; default = 0)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


LEADER  [ACG]
DXF Group Codes

 ENTITIES Section

  LEADER

The following group codes apply to leader entities.

Leader group codes

Group codes	Description
100	Subclass marker (AcDbLeader)
3	Dimension style name
71	Arrowhead flag: 0 = disabled; 1 = enabled
72	Leader path type: 0 = Straight line segments; 1 = Spline
73	Leader creation flag (default = 3): 0 = leader created with text annotation. 1 = created with tolerance annotation 2 = created with block reference annotation 3 = created without any annotation
74	Hookline direction flag: 0 = hookline (or end of tangent for a splined leader) is the opposite direction from the horizontal vector. 1 = hookline (or end of tangent for a splined leader) is the same direction as horizontal vector (see code 75).
75	Hookline flag: 0 = no hookline; 1 = has a hookline
40	Text annotation height
41	Text annotation width
76	Number of vertices in leader (ignored for DXFIN)
10	Vertex coordinates (one entry for each vertex) DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of vertex coordinates
77	Color to use if leader's DIMCLRD=BYBLOCK
340	Hard reference to associated annotation (mtext, tolerance, or insert entity)
210	Normal vector. DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of normal vector
211	"Horizontal" direction for leader.  DXF: X value; APP: 3D vector.
221,231	DXF: Y and Z values of "horizontal" direction for leader
212	Block reference insertion point offset from last leader vertex. DXF: X value; APP: 3D vector
222,232	DXF: Y and Z values of block reference insertion point offset from last leader vertex.
213	Annotation placement point offset from last leader vertex. DXF: X value; APP: 3D vector
223,233	DXF: Y and Z values of annotation placement point offset from last leader vertex.
Xdata belonging to the application ID "ACAD" may follow. This describes any dimension overrides that have been applied to this entity. See "Dimension Style Overrides."


LINE  [ACG]
DXF Group Codes

 ENTITIES Section

  LINE

The following group codes apply to line entities.

Line group codes

Group codes	Description
100	Subclass marker (AcDbLine)
39	Thickness (optional; default = 0)
10	Start point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of start point (in WCS)
11	End point (in WCS). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of end point (in WCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


LWPOLYLINE  [ACG]
DXF Group Codes

 ENTITIES Section

  LWPOLYLINE

The following group codes apply to lwpolyline entities.

Lwpolyline group codes

Group codes	Description
100	Subclass marker (AcDbPolyline)
90	Number of vertices.
70	Polyline flag (bit-coded); default is 0: 1 = closed 128 = plinegen
43	Constant width (optional; default = 0) Not used if variable width (codes 40 and/or 41) is set.
38	Elevation (optional; default = 0)
39	Thickness (optional; default = 0)
10	Vertex coordinates (in OCS), multiple entries; one entry for each vertex. DXF: X value; APP: 2D point
20	DXF: Y value of vertex coordinates (in OCS), multiple entries; one entry for each vertex
40	Starting width (multiple entries; one entry for each vertex) (optional; default = 0; multiple entries). Not used if constant width (code 43) is set.
41	End width (multiple entries; one entry for each vertex) (optional; default = 0; multiple entries). Not used if constant width (code 43) is set.
42	Bulge (multiple entries; one entry for each vertex)  (optional; default = 0).
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


MLINE  [ACG]
DXF Group Codes

 ENTITIES Section

  MLINE

The following group codes apply to mline entities.

Mline group codes

Group codes	Description
100	Subclass marker (AcDbMline)
2	String of up to 32 characters. The name of the style used for this mline. An entry for this style must exist in the MLINESTYLE dictionary.  NOTE Do not modify this field.
340	Pointer-handle/ID of MLINESTYLE dictionary
40	Scale factor.
70	Justification: 0=top, 1=zero, 2=bottom
71	Flags (bit-coded values): 1=unlocked; 2=closed; 4=supress start caps; 8=supress end caps
72	Number of vertices
73	Number of elements in MLINESTYLE definition
10	Start point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of start point (in WCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
11	Vertex coordinates (multiple entries; one entry for each vertex). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of vertex coordinates
12	Direction vector of segment starting at this vertex  (multiple entries; one for each vertex). DXF: X value; APP: 3D vector
22, 32	DXF: Y and Z values of direction vector of segment starting at this vertex
13	Direction vector of miter at this vertex (multiple entries: one for each vertex). DXF: X value; APP: 3D vector
23, 33	DXF: Y and Z values of direction vector of miter
74	Number of parameters for this element (repeats for each element in segment)
41	Element parameters (repeats based on previous code 74)
75	Number of area fill parameters for this element (repeats for each element in segment)
42	Area fill parameters (repeats based on previous code 75)
The group code 41 parameterization is a list of real values, one real per group code 41. The list  may contain zero or more items. The first group code 41 value is the distance from the segment vertex along the miter vector to the point where the line element's path intersects the miter vector. The next group code 41 value is the distance along the line element's path from the point defined by the first group 41 to the actual start of the line element. The next is the distance from the start of the line element to the first break (or cut) in the line element. The successive group code 41 values continue to list the start and stop points of the line element in this segment of the mline. Linetypes do not affect group 41 lists.

The group code 42 parameterization is also a list of real values. Similar to the 41 parameterization, it describes the parameterization of the fill area for this mline segment. The values are interpreted identically to the 41 parameters and when taken as a whole for all line elements in the mline segment, they define the boundary of the fill area for the mline segment.

A common example of the use of the group code 42 mechanism is when an unfilled mline crosses over a filled mline and mledit is used to cause the filled mline to appear unfilled in the crossing area. This would result in two group 42s for each line element in the affected mline segment, one for the fill stop and one for the fill start.

The 2 group codes in mline entities and mlinestyle objects are redundant fields. These groups should not be modified under any circumstances, although it is safe to read them and use their values. The correct fields to modify are as follows:

Mline

The 340 group in the same object, which indicates the proper mlinestyle object.

Mlinestyle

The 3 group value in the mlinestyle dictionary which precedes the 350 group that has the handle or entity name of the current mlinestyle.


MTEXT  [ACG]
DXF Group Codes

 ENTITIES Section

  MTEXT

The following group codes apply to mtext entities.

Mtext group codes

Group codes	Description
100	Subclass marker (AcDbMText)
10	Insertion point. DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of insertion point
40	Default text height
41	Reference rectangle width
71	Attachment point: 1 = Top left; 2 = Top center; 3 = Top right;  4 = Middle left; 5 = Middle center; 6 = Middle right 7 = Bottom left; 8 = Bottom center; 9 = Bottom right
72	Drawing direction: 1 = Left to right;  3 = Top to bottom;  5 = By style (the flow direction is inherited from the associated text style)
1	Text string. If the text string is less than 250 characters, all characters appear in group 1. If the text string is greater than 250 characters, the string is divided into 250 character chunks, which appear in one or more group 3 codes. If group 3 codes are used, the last group is a group 1 and has fewer than 250 characters.
3	Additional text (always in 250 character chunks).
7	Text style name (STANDARD if not provided)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
11	X-axis direction vector (in WCS) DXF: X value; APP: 3D vector NOTE  A group code 50 (rotation angle in radians) passed as DXF input is converted to the equivalent direction vector (if both a code 50 and codes 11,21,31 are passed, the last one wins). This is provided as a convenience for conversions from text objects.
21, 31	DXF: Y and Z values of X-axis direction vector (in WCS)
42	Horizontal width of the characters that make up the mtext object. (This value will always be equal to or less than the value of group code 41.)
43	Vertical height of the characters that make up the mtext object.
50	Rotation angle in radians.


OLEFRAME  [ACG]
DXF Group Codes

 ENTITIES Section

  OLEFRAME

The following group codes apply to oleframe entities.

Oleframe group codes

Group codes	Description
100	Subclass marker (AcDbOleFrame)
70	OLE version number
90	Length of binary data
310	Binary data (multiple lines)
1	End of Ole data (the string "OLE")


OLE2FRAME  [ACG]
DXF Group Codes

 ENTITIES Section

  OLE2FRAME

The following group codes apply to ole2frame entities.This information is read only. During DXFIN, the values are ignored, because they are part of the OLE binary object, and are obtained via access functions.

Ole2frame group codes

Group codes	Description
100	Subclass marker (AcDbOle2Frame)
70	OLE version number
3	Length of binary data
10	Upper left corner (WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of upper left corner (in WCS)
11	Lower right corner (WCS). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of lower right corner (in WCS)
71	OLE object type, 1 = link, 2 = embedded, 3 = static
72	Tile mode descriptor, 0 = object is in a tiled model space viewport 1 = object is in a non-tiled viewport (paper space or  floating model space)
90	Length of binary data
310	Binary data (multiple lines)
1	End of Ole data (the string "OLE")
Sample DXF output:

    OLE2FRAME

      5

    2D

    100

    AcDbEntity

     67

         1

      8

    0

    100

    AcDbOle2Frame

     70

         2

      3

    Paintbrush Picture

     10

    4.43116

     20

    5.665992

     30

    0.0

     11

    6.4188

     21

    4.244939

     31

    0.0

     71

         2

     72

         1

     90

        23680

    310   0155764BD60082B91140114B08C8F9A916400000000000000000506DC0D0D9AC

    310

    1940114B08C8F9A916400000000000000000506DC0D0D9AC194002303E5CD1FA

    310

    10400000000000000000764BD60082B9114002303E5CD1FA1040000000000000

    ...

    ...

AutoLISP entnext function sample output:

    Command:  (setq e (entget e3))
    ((-1 . <Entity name: 7d50428>) (0 . "OLE2FRAME") (5 . "2D")
    (100 . "AcDbEntity") (67 . 1) (8 . "0") (100 . "AcDbOle2Frame")
    (70 . 2) (3 "Paintbrush Picture") (10 4.43116 5.66599 0.0)
    (11 6.4188 4.24494 0.0) (71 . 2) (72 . 1))


POINT  [ACG]
DXF Group Codes

 ENTITIES Section

  POINT

The following group codes apply to point entities.

Point group codes

Group codes	Description
100	Subclass marker (AcDbPoint)
10	Point location (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of point location (in WCS)
39	Thickness (optional; default = 0)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
50	Angle of the X axis for the UCS in effect when the point was drawn (optional, default = 0); used when PDMODE is nonzero


POLYLINE  [ACG]
DXF Group Codes

 ENTITIES Section

  POLYLINE

The following group codes apply to polyline entities.

Polyline group codes

Group codes	Description
100	Subclass marker (AcDb2dPolyline or AcDb3dPolyline)
10	DXF: always 0 APP: a "dummy" point; the X and Y values are always 0, and the Z value is the polyline's elevation (in OCS when 2D, WCS when 3D)
20	DXF: always 0
30	DXF: polyline's elevation (in OCS when 2D, WCS when 3D)
39	Thickness (optional; default = 0)
70	Polyline flag (bit-coded); default is 0: 1 = This is a closed polyline (or a polygon mesh closed in the M direction). 2 = Curve-fit vertices have been added. 4 = Spline-fit vertices have been added. 8 = This is a 3D polyline. 16 = This is a 3D polygon mesh. 32 = The polygon mesh is closed in the N direction. 64 = The polyline is a polyface mesh. 128 = The linetype pattern is generated continuously around the vertices of this polyline.
40	Default starting width (optional; default = 0)
41	Default ending width (optional; default = 0)
71	Polygon mesh M vertex count (optional; default = 0)
72	Polygon mesh N vertex count (optional; default = 0)
73	Smooth surface M density (optional; default = 0)
74	Smooth surface N density (optional; default = 0)
75	Curves and smooth surface type (optional; default = 0); integer codes, not bit-coded: 0 = No smooth surface fitted 5 = Quadratic B-spline surface 6 = Cubic B-spline surface 8 = Bezier surface
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
Xdata with the "AUTOCAD_POSTSCRIPT_FIGURE" application ID may follow. This contains information related to PostScript images and PostScript fill information.

Topics in this section:

   Polyface Meshes


Polyface Meshes  [ACG]
DXF Group Codes

 ENTITIES Section

  POLYLINE

   Polyface Meshes

A polyface mesh is represented in DXF as a variant of a polyline entity. The polyline header is identified as introducing a polyface mesh by the presence of the 64 bit in the polyline flags (70) group. The 71 group specifies the number of vertices in the mesh, and the 72 group specifies the number of faces. Although these counts are correct for all meshes created with the PFACE command, applications are not required to place correct values in these fields. Following the polyline header is a sequence of vertex entities that specify the vertex coordinates, then followed by faces that compose the mesh.

The AutoCAD entity structure imposes a limit on the number of vertices that a given face entity can specify. You can represent more complex polygons by decomposing them into triangular wedges. Their edges should be made invisible to prevent visible artifacts of this subdivision from being drawn. The PFACE command performs this subdivision automatically, but when applications generate polyface meshes directly, the applications must do this themselves. The number of vertices per face is the key parameter in this subdivision process. The PFACEVMAX system variable provides an application with the number of vertices per face entity. This value is read-only and is set to 4.

Polyface meshes created with the PFACE command are always generated with all the vertex coordinate entities first, followed by the face definition entities. The code within AutoCAD that processes polyface meshes requires this ordering. Programs that generate polyface meshes in DXF should generate all the vertices then all the faces. However, programs that read polyface meshes from DXF should be tolerant of odd vertex and face ordering.


RAY  [ACG]
DXF Group Codes

 ENTITIES Section

  RAY

The following group codes apply to ray entities.

Ray group codes

Group codes	Description
100	Subclass marker (AcDbRay)
10	Start point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of start point (in WCS)
11	Unit direction vector (in WCS).  DXF: X value; APP: 3D vector
21, 31	DXF: Y and Z values of unit direction vector (in WCS)


REGION  [ACG]
DXF Group Codes

 ENTITIES Section

  REGION

The following group codes apply to region entities.

Region group codes

Group codes	Description
100	Subclass marker (AcDbModelerGeometry)
70	Modeler format version number (currently = 1)
1	Proprietary data (multiple lines < 255 characters each)
3	Additional lines of proprietary data (if previous group 1 string is greater than 255 characters)


SEQEND  [ACG]
DXF Group Codes

 ENTITIES Section

  SEQEND

The following group codes apply to seqend entities.

Seqend group codes

Group codes	Description
-2	APP: name of entity that began the sequence. This entity marks the end of vertex (vertex type name) for a polyline, or the end of attribute entities (attrib type name) for an insert entity that has attributes (indicated) by 66 group present and nonzero in insert entity).  This code is not saved in a DXF file.


SHAPE  [ACG]
DXF Group Codes

 ENTITIES Section

  SHAPE

The following group codes apply to shape entities.

Shape group codes

Group codes	Description
100	Subclass marker (AcDbShape)
39	Thickness (optional; default = 0)
10	Insertion point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of insertion point (in WCS)
40	Size
2	Shape name
50	Rotation angle (optional; default = 0)
41	Relative X scale factor (optional; default =1)
51	Oblique angle (optional; default =0)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


SOLID  [ACG]
DXF Group Codes

 ENTITIES Section

  SOLID

The following group codes apply to solid entities.

Solid group codes

Group codes	Description
100	Subclass marker (AcDbTrace)
10	First corner. DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of first corner
11	Second corner. DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of second corner
12	Third corner. DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of third corner
13	Fourth corner. If only three corners are entered to define the SOLID, then the fourth corner coordinate is the same as the third DXF: X value; APP: 3D point
23, 33	DXF: Y and Z values of fourth corner
39	Thickness (optional; default = 0)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


SPLINE  [ACG]
DXF Group Codes

 ENTITIES Section

  SPLINE

The following group codes apply to spline entities.

Spline group codes

Group codes	Description
100	Subclass marker (AcDbSpline)
210	Normal vector (omitted if the spline is nonplanar) DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of normal vector
70	Spline flag (bit coded): 1 = Closed spline 2 = Periodic spline 4 = Rational spline 8 = Planar 16 = Linear (planar bit is also set)
71	Degree of the spline curve
72	Number of knots
73	Number of control points
74	Number of fit points (if any)
42	Knot tolerance (default = 0.0000001)
43	Control-point tolerance (default = 0.0000001)
44	Fit tolerance (default = 0.0000000001)
12	Start tangent--may be omitted (in WCS). DXF: X value; APP: 3D point.
22, 32	DXF: Y and Z values of start tangent--may be omitted (in WCS).
13	End tangent--may be omitted (in WCS). DXF: X value; APP: 3D point.
23, 33	DXF: Y and Z values of end tangent--may be omitted (in WCS)
40	Knot value (one entry per knot)
41	Weight (if not 1); with multiple group pairs, are present if all are not 1
10	Control points (in WCS) one entry per control point. DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of control points (in WCS) (one entry per control point)
11	Fit points (in WCS) one entry per fit point. DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of fit points (in WCS) (one entry per fit point)


TEXT  [ACG]
DXF Group Codes

 ENTITIES Section

  TEXT

The following group codes apply to text entities.

Text group codes

Group codes	Description
100	Subclass marker (AcDbText)
39	Thickness (optional; default = 0)
10	First alignment point (in OCS)  DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of first alignment point (in OCS)
40	Text height
1	Default value (the string itself)
50	Text rotation (optional; default = 0)
41	Relative X scale factor--width (optional; default = 1). This value is also adjusted when fit-type text is used.
51	Oblique angle (optional; default = 0)
7	Text style name (optional, default = STANDARD)
71	Text generation flags (optional, default = 0): 2 = Text is backward (mirrored in X), 4 = Text is upside down (mirrored in Y)
72	Horizontal text justification type (optional, default = 0) integer codes (not bit-coded) 0 = Left;1= Center; 2 = Right 3 = Aligned (if vertical alignment = 0) 4 = Middle (if vertical alignment = 0) 5 = Fit (if vertical alignment = 0) See the following table for clarification
11	Second alignment point (in OCS).  DXF: X value; APP: 3D point. This value is meaningful only if the value of a 72 or 73 group is nonzero (if the justification is anything other than baseline/left)
21, 31	DXF: Y and Z values of second alignment point (in OCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
100	Subclass marker (AcDbText)
73	Vertical text justification type (optional, default = 0): integer codes (not bit- coded) 0 = Baseline; 1 = Bottom; 2 = Middle; 3 = Top See the following table for clarification.
The following table describes the group codes 72 (horizontal alignment) and 73 (vertical alignment) in greater detail.

Group 72 and 73 integer codes

Group 73	Group 72 0	1	2	3	4	5
3 (top)	TLeft	TCenter	TRight
2 (middle)	MLeft	MCenter	MRight
1 (bottom)	BLeft	BCenter	BRight
0 (baseline)	Left	Center	Right	Aligned	Middle	Fit
If group 72 and/or 73 values are nonzero then the first alignment point values are ignored and AutoCAD calculates new values based on the second alignment point and the length and height of the text string itself (after applying the text style). If the 72 and 73 values are zero or missing, then the second alignment point is meaningless.


TOLERANCE  [ACG]
DXF Group Codes

 ENTITIES Section

  TOLERANCE

The following group codes apply to tolerance entities.

Tolerance group codes

Group codes	Description
100	Subclass marker (AcDbFcf)
3	Dimension style name
10	Insertion point. (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of insertion point (in WCS)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
11	X-axis direction vector (in WCS) DXF: X value; APP: 3D vector
21, 31	DXF: Y and Z values of X-axis direction vector (in WCS)


TRACE  [ACG]
DXF Group Codes

 ENTITIES Section

  TRACE

The following group codes apply to trace entities.

Trace group codes

Group codes	Description
100	Subclass marker (AcDbTrace)
10	First corner (in OCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of first corner (in OCS)
11	Second corner (in OCS). DXF: X value; APP: 3D point
21, 31	DXF: Y and Z values of second corner (in OCS)
12	Third corner (in OCS). DXF: X value; APP: 3D point
22, 32	DXF: Y and Z values of third corner (in OCS)
13	Fourth corner (in OCS). DXF: X value; APP: 3D point
23, 33	DXF: Y and Z values of fourth corner (in OCS)
39	Thickness (optional; default = 0)
210	Extrusion direction. (optional; default = 0, 0, 1).  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction


VERTEX  [ACG]
DXF Group Codes

 ENTITIES Section

  VERTEX

The following group codes apply to vertex entities.

Vertex group codes

Group codes	Description
100	Subclass marker (AcDbVertex)
100	Subclass marker (AcDb2dVertex or AcDb3dPolylineVertex)
10	Location point (in OCS when 2D, and WCS when 3D). DXF: X value; APP: 3D point.
20, 30	DXF: Y and Z values of location point (in OCS when 2D, and WCS when 3D)
40	Starting width (optional; default is 0)
41	Ending width (optional; default is 0)
42	Bulge (optional; default is 0). The bulge is the tangent of one fourth the included angle for an arc segment, made negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.
70	Vertex flags: 1 = Extra vertex created by curve-fitting. 2 = Curve-fit tangent defined for this vertex. A curve-fit tangent direction of 0 may be omitted from DXF output  but is significant if this bit is set. 4 = Not used 8 = Spline vertex created by spline-fitting 16 = Spline frame control point 32 = 3D polyline vertex 64 = 3D polygon mesh 128 = Polyface mesh vertex
50	Curve fit tangent direction
71	Polyface mesh vertex index. Optional. Present only if nonzero.
72	Polyface mesh vertex index. Optional. Present only if nonzero.
73	Polyface mesh vertex index. Optional. Present only if nonzero.
74	Polyface mesh vertex index. Optional. Present only if nonzero.
Every vertex that is part of a polyface mesh has its vertex flag 128 bit set. If the entity supplies the coordinate of a vertex of the mesh, its 64 bit is set as well, and the 10, 20, 30 groups give the vertex coordinate. The vertex index values are determined by the order in which the vertex entities appear within the polyline, with the first being numbered 1.

If the vertex defines a face of the mesh, its vertex flags group has the 128 bit set but not the 64 bit. In this case, the 10, 20, 30 (location) groups of the face entity are irrelevant and are always written as 0 in a DXF file. The vertex indexes that define the mesh are given by 71, 72, 73, and 74 group codes, the values of which specify one of the previously defined vertexes by index. If the index is negative, the edge that begins with that vertex is invisible. The first 0 vertex marks the end of the vertices of the face.


VIEWPORT  [ACG]
DXF Group Codes

 ENTITIES Section

  VIEWPORT

The following group codes apply to viewport entities.

Viewport group code

Group codes	Description
100	Subclass marker (AcDbViewport)
10	Center point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of center point (in WCS)
40	Width in paper space units
41	Height in paper space units.
68	Viewport status field: -1 = On, but is fully off screen, or is one of the viewports that is not active because the $MAXACTVP count is currently being exceeded. 0 = Off  <positive value > = On and active. The value indicates the order of stacking for the viewports, where 1 is the active viewport, 2 is the next, and so forth.
69	Viewport ID. Changes each time a drawing is opened. Never saved, except for the paper space viewport, which is always 1.
The following table lists the xdata that can be attached to viewport entities. In contrast to normal entity data, the order of the extended group codes is important. Also group codes can appear multiple times.

Viewport xdata group codes

Group codes	Description
1001	Application ID ("ACAD"). This begins a section of xdata that describes the viewport.
1000	Begin viewport data. This field is always the string MVIEW. Other data groups may appear in the future.
1002	Begin window descriptor data. This field always is the string.
1070	Extended data version number. Always the integer 16.
1010	View target point (in WCS). DXF: X value; APP: 3D point
1020,1030	DXF: Y and Z values of view target point (in WCS)
1010	View direction vector (in WCS).  DXF: X value; APP: 3D vector.
1020,1030	DXF: Y and Z values of view direction vector (in WCS)
1040	View twist angle
1040	View height
1040	View center point X value (in DCS)
1040	View center point Y value (in DCS)
1040	Perspective lens length
1040	Front clip plane Z value
1040	Back clip plane Z value
1070	View mode
1070	Circle zoom
1070	Fast zoom setting
1070	UCSICON setting
1070	Snap ON/OFF
1070	Grid ON/OFF
1070	Snap style
1070	Snap ISOPAIR
1040	Snap angle
1040	Snap base point UCS X value of coordinate
1040	Snap base point UCS Y value of coordinate
1040	Snap X spacing
1040	Snap Y spacing
1040	Grid X spacing
1040	Grid Y spacing
1070	Hidden in plot flag
1002	Begin frozen layer list (possibly empty). This field always is the string "{".
1003	The names of layers frozen in this viewport. This list may include xref-dependent layers. Any number of 1003 groups may appear here.
1002	End frozen layer list. This field always is the string "}".
1002	End viewport data. This field always is the string "}".
Note  The ZOOM XP factor is calculated with the following formula: group_41 / 2nd_group_1040 (or pspace_height / mspace_height).


XLINE  [ACG]
DXF Group Codes

 ENTITIES Section

  XLINE

The following group codes apply to xline entities.

Xline group codes

Group codes	Description
100	Subclass marker (AcDbXline)
10	First point (in WCS). DXF: X value; APP: 3D point
20, 30	DXF: Y and Z values of first point (in WCS)
11	Unit direction vector (in WCS).  DXF: X value; APP: 3D vector.
21, 31	DXF: Y and Z values of unit direction vector (in WCS)


OBJECTS Section  [ACG]
DXF Group Codes

 OBJECTS Section

This section presents the group codes that apply to nongraphical objects. These codes are found in the OBJECTS section of a DXF file and are used by AutoLISP and ARX applications in entity definition lists.

The group codes shown in this section can apply to DXF files, applications (AutoLISP or ARX), or both. When the description of a code is different for applications and DXF files (or only applies to one or the other), the description is preceeded by the following indicators:

APP   	Application-specific description

DXF   	DXF file-specific description

If the description is common to both DXF files and applications, no indicator is provided. Otherwise, the appropriate indicator is present. Optional codes are shown in gray.

Objects are similar to entities, except that they have no graphical or geometric meaning. All objects that are not entities or symbol table records or symbol tables are stored in this section. This section represents a homogeneous heap of objects with topological ordering of objects by ownership, such that the owners always appear before the objects they own.

Topics in this section:

   Object Ownership

   Object Group Codes in DXF Files

   Common Object Group Codes

   ACAD_PROXY_OBJECT

   DICTIONARY

   DICTIONARYVAR

   GROUP

   IDBUFFER

   IMAGEDEF

   IMAGEDEF_REACTOR

   LAYER_INDEX

   MLINESTYLE

   OBJECT_PTR

   RASTERVARIABLES

   SPATIAL_INDEX

   SPATIAL_FILTER

   SORTENTSTABLE

   XRECORD


Object Ownership  [ACG]
DXF Group Codes

 OBJECTS Section

  Object Ownership

The root owner of most objects appearing in the OBJECTS section is the named object dictionary, which is, therefore, always the first object that appears in this section. Objects that are not owned by the named object dictionary are owned by other entities, objects, or symbol table entries. Objects in this section may be defined by AutoCAD or by applications with access to ARX API. The DXF names of application-defined object types should always be associated with a class name in the CLASS section of the DXF file, or else the object record cannot be bound to the application that will interpret it.

As with other dictionaries, the named-object dictionary record consists solely of associated pairs of entry names and hard ownership pointer references to the associated object.

To avoid name collision between objects, developers should always use their registered developer prefix for their entries.


Object Group Codes in DXF Files  [ACG]
DXF Group Codes

 OBJECTS Section

  Object Group Codes in DXF Files

The following is an example of the OBJECTS section of a DXF file:

0 SECTION   2 OBJECTS	Beginning of OBJECTS section
0 DICTIONARY   5 <handle> 100 AcDbDictionary	Beginning of named object dictionary (root dictionary  object)
3 <dictionary name> 350 <handle of child>	Repeats for each entry
0 <object type>  .  . <data>  .	Groups of object data
0 ENDSEC	End of OBJECTS section


Common Object Group Codes  [ACG]
DXF Group Codes

 OBJECTS Section

  Common Object Group Codes

The following table shows group codes that apply to virtually all non-graphical entities (objects). When you refer to the table of group codes by entity type, which lists the codes associated with specific entities, keep in mind that the codes shown here can also be present. Some of the group codes are included with an entity only if the entity has non-default values for these properties. When a group is omitted, its default value upon input (when using DXFIN) is indicated in the third column. If the value of a group code is equal to the default, it is omitted upon output (when using DXFOUT).

Common object group codes

Group codes	Description
0	Object type
5	Handle
102	Start of application defined group "{application_name". For example, "{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group.
application-defined codes	Codes and values within the 102 groups are application-defined.
102	End of group, "}"
The following table shows the group codes that are output if persistent reactors have been attached to an object.

ACAD_REACTORS records

Group code	Description
102	"{ACAD_REACTORS" indicates the start of the AutoCAD persistent reactors group
330	Soft-pointer ID/handle to owner dictionary
102	End of group, "}"
The following table shows the group codes that are output if an extension dictionary has been attached to an object.

ACAD_XDICTIONARY records

Group code	Description
102	"{ACAD_XDICTIONARY" indicates the start of an extension dictionary group
360	Hard-owner ID/handle to owner dictionary
102	End of group, "}"


ACAD_PROXY_OBJECT  [ACG]
DXF Group Codes

 OBJECTS Section

  ACAD_PROXY_OBJECT

The following group codes apply to ACAD_PROXY_OBJECT objects.

Acad_proxy_object group codes

Group codes	Description
100	DXF: Subclass marker (AcDbProxyObject)
90	DXF: Proxy object class ID (always 499)
91	DXF: Application object's class ID. Class IDs are based on the order of the class in the CLASSES section. The first class is given the ID of 500, the next is 501, and so on.
93	DXF: Size of object data in bits
310	DXF: Binary object data (multiple entries can appear).
330 or 340 or 350 or 360	DXF: An object ID (multiple entries can appear).
94	DXF: 0 (indicates end of object ID section)
The 92 field is not used for AcDbProxyObject. Objects of this class never have graphics.


DICTIONARY  [ACG]
DXF Group Codes

 OBJECTS Section

  DICTIONARY

The following group codes are used by DICTIONARY objects.

DICTIONARY group codes

Group codes	Description
100	Subclass marker (AcDbDictionary)
3	Entry name (one for each entry)
350	Handle of entry object (one for each entry)
AutoCAD maintains items such as mline styles and group definitions as objects in dictionaries. The following sections describe the AutoCAD object group codes maintained in dictionaries; however, other applications are free to create and use their own dictionaries as they see fit. Note that the prefix "ACAD_" is reserved for use by AutoCAD applications.


DICTIONARYVAR  [ACG]
DXF Group Codes

 OBJECTS Section

  DICTIONARYVAR

The following group codes are used by DICTIONARYVAR objects.

DICTIONARYVAR group codes

Group codes	Description
0	Object name (DICTIONARYVAR)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary (ACDBVARIABLEDICTIONARY).
102	End of persistent reactors group, always "}"
100	Subclass marker (DictionaryVariables)
280	Object schema number (currently set to 0)
1	Value of variable
DICTIONARYVAR objects are used by AutoCAD as a means to store named values in the database for setvar/getvar purposes without the need to add entries to the DXF HEADER section. Currently, the system variables that are stored as DICTIONARYVAR objects are: DIMADEC, DIMDSEP, INDEXCTL, PROJECTNAME, and XCLIPFRAME.


GROUP  [ACG]
DXF Group Codes

 OBJECTS Section

  GROUP

The following group codes are used by GROUP objects.

GROUP group codes

Group codes	Description
0	Object name (GROUP)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS" (persistent reactors group appears in all dictionaries except the main dictionary)
330	Soft-pointer ID/handle to owner dictionary. For GROUP objects this is always the ACAD_GROUP entry of the named object dictionary.
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbGroup)
300	Group description
70	"Unnamed" flag: 1 = unnamed; 0 = named
71	Selectability flag: 1 = selectable; 0 = not selectable
340	Handle of entity in group (one entry per object)


IDBUFFER  [ACG]
DXF Group Codes

 OBJECTS Section

  IDBUFFER

The following group codes are used by IDBUFFER objects.

IDBUFFER  group codes

Group codes	Description
0	Object name (IDBUFFER)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary.
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbIdBuffer)
330	Soft pointer reference to entity (multiple entries may exist)
The IDBUFFER object is a utility object that is just a list of references to objects.


IMAGEDEF  [ACG]
DXF Group Codes

 OBJECTS Section

  IMAGEDEF

The following group codes are used by IMAGEDEF objects.

IMAGEDEF  group codes

Group codes	Description
0	Object name (IMAGEDEF)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to the ACAD_IMAGE_DICT dictionary.
330	Soft-pointer ID/handle to IMAGEDEF_REACTOR object (multiple entries; one for each instance).
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbRasterImageDef)
90	Class version. 0=R14 version
1	File name of image
10	Image size in pixels. DXF: U value; APP: 2D point (U and V values)
20	DXF: V value of image size in pixels
11	Default size of one pixel in AutoCAD units.  DXF: U value; APP: 2D point (U and V values)
12	DXF: V value of pixel size.
280	Image-is-loaded flag. 0=Unloaded; 1=Loaded
281	Resolution units. 0=No units; 2=Centimeters; 5=Inch


IMAGEDEF_REACTOR  [ACG]
DXF Group Codes

 OBJECTS Section

  IMAGEDEF_REACTOR

The following group codes are used by IMAGEDEF_REACTOR objects.

IMAGEDEF_REACTOR  group codes

Group codes	Description
0	Object name (IMAGEDEF_REACTOR)
5	Handle
100	Subclass marker (AcDbRasterImageDefReactor)
90	Class version. 2=R14 version
330	Object ID for associated image object.


LAYER_INDEX  [ACG]
DXF Group Codes

 OBJECTS Section

  LAYER_INDEX

The following group codes are used by LAYER_INDEX objects.

LAYER_INDEX  group codes

Group codes	Description
0	Object name (LAYER_INDEX)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary.
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbIndex)
40	Time stamp (Julian date)
100	Subclass marker (AcDbLayerIndex)
8	Layer name (multiple entries may exist)
360	Hard owner reference to IDBUFFER (multiple entries may exist)
90	Number of entries in the IDBUFFER list (multiple entries may exist)


MLINESTYLE  [ACG]
DXF Group Codes

 OBJECTS Section

  MLINESTYLE

The following group codes are used by MLINESTYLE objects.

MLINESTYLE group codes

Group codes	Description
0	Object name (MLINESTYLE)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS" (persistent reactors group appears in all dictionaries except the main dictionary)
330	Soft-pointer ID/handle to owner dictionary. For MLINESTYLE objects this is always the ACAD_MLINESTYLE entry of the named object dictionary.
102	End of persistent reactors group; always "}"
100	Subclass marker (AcDbMlineStyle)
2	Mline style name
70	Flags (bit coded): 1 = fill on 2 = display miters 16 = Start square end (line) cap 32 = Start inner arcs cap 64 = Start round (outer arcs) cap 256 = End square (line) cap 512 = End inner arcs 1024 = End round (outer arcs) cap
3	Style description (string, 255 characters maximum)
62	Fill color (integer, default = 256).
51	Start angle (real, default is 90 degrees)
52	End angle (real, default is 90 degrees)
71	Number of elements
49	Element offset (real, no default). Multiple entries can exist; one entry for each element.
62	Element color (integer, default = 0). Multiple entries can exist; one entry for each element.
6	Element linetype (string, default = BYLAYER). Multiple entries can exist; one entry for each element.
The 2 group codes in mline entities and mlinestyle objects are redundant fields. These groups should not be modified under any circumstances, although it is safe to read them and use their values. The correct fields to modify are:

Mline

The 340 group in the same object, which indicates the proper MLINESTYLE object.

Mlinestyle

The 3 group value in the MLINESTYLE dictionary, which precedes the 350 group that has the handle or entity name of the current MLINESTYLE.


OBJECT_PTR  [ACG]
DXF Group Codes

 OBJECTS Section

  OBJECT_PTR

The following group codes are used by OBJECT_PTR objects.

OBJECT_PTR  group codes

Group codes	Description
0	Object name (OBJECT_PTR)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary.
102	End of persistent reactors group, always "}"
1001	Begin ASE xdata (ACADASER13)


RASTERVARIABLES  [ACG]
DXF Group Codes

 OBJECTS Section

  RASTERVARIABLES

The following group codes are used by RASTERVARIABLES objects.

RASTERVARIABLES  group codes

Group codes	Description
0	Object name (RASTERVARIABLES)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary. For a RASTERVARIABLES object this is always the ACAD_IMAGE_VARS entry of the named object dictionary.
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbRasterVariables)
90	Class version. 0=R14 version
70	Display-image-frame flag. 0=No frame; 1=Display frame
71	Image display quality (screen only). 0=Draft; 1=High
72	AutoCAD units for inserting images. This is what one AutoCAD unit is equal to for the purpose of inserting and scaling images with an associated resolution. 0=None 1=Millimeter 2=Centimeter 3=Meter 4=Kilometer 5=Inch 6=Foot 7=Yard 8=Mile


SPATIAL_INDEX  [ACG]
DXF Group Codes

 OBJECTS Section

  SPATIAL_INDEX

The following group codes are used by SPATIAL_INDEX objects.

SPATIAL_INDEX  group codes

Group codes	Description
0	Object name (SPATIAL_INDEX)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary.
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbIndex)
40	Timestamp (Julian date)
100	Subclass marker (AcDbSpatialIndex)
The SPATIAL_INDEX is always written out empty to a DXF file. This object can be ignored.


SPATIAL_FILTER  [ACG]
DXF Group Codes

 OBJECTS Section

  SPATIAL_FILTER

The following group codes are used by SPATIAL_FILTER objects.

SPATIAL_FILTER  group codes

Group codes	Description
0	Object name (SPATIAL_FILTER)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary (SPATIAL).
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbFilter)
100	Subclass marker (AcDbSpatialFilter)
70	Number of points on the clip boundary.  2=Rectangular clip boundary (lower-left and upper-right) greater than 2=Polyline clip boundary
10	Clip boundary definition point (in OCS) (always 2 or more) based on an xref scale of 1. DXF: X value; APP: 2D point
20	DXF: Y value of boundary definition point (always 2 or more)
210	Normal to the plane containing the clip boundary.  DXF: X value; APP: 3D vector
220, 230	DXF: Y and Z values of extrusion direction
11	Origin used to define the local coordinate system of the clip boundary. DXF: X value; APP: 3D point
21, 31	Origin used to define the local coordinate system of the clip boundary. DXF: Y and Z values
71	Clip boundary display enabled flag.  0=disabled; 1=enabled
72	Front clipping plane flag. 0=no; 1=yes
40	Front clipping plane distance (if code 72 = 1)
73	Back clipping plane flag. 0=no; 1=yes
41	Back clipping plane distance (if code 73 = 1)
40	4x3 transformation matrix written out in column major order. This matrix is the inverse of the original block reference (insert entity) transformation. The original block reference transformation is the one that is applied to all entities in the block when the block reference is regenerated. (always 12 entries)
40	4x3 transformation matrix written out in column major order that transforms points into the coordinate system of the clip boundary.  (12 entries)


SORTENTSTABLE  [ACG]
DXF Group Codes

 OBJECTS Section

  SORTENTSTABLE

The following group codes are used by SORTENTSTABLE objects.

SORTENTSTABLE  group codes

Group codes	Description
0	Object name (SORTENTSTABLE)
5	Handle
102	Start of persistent reactors group; always "{ACAD_REACTORS"
330	Soft-pointer ID/handle to owner dictionary (ACAD_SORTENTS).
102	End of persistent reactors group, always "}"
100	Subclass marker (AcDbSortentsTable)
330	Soft pointer ID/handle to owner (currently only the *MODEL_SPACE or *PAPER_SPACE blocks)
331	Soft pointer ID/handle to an entity (zero or more entries may exist)
5	Sort handle (zero or more entries may exist)
If the SORTENTS Regen flag (bit-code value 16) is set, AutoCAD regenerates entities in ascending handle order. When the DRAWORDER command is used a SORTENTSTABLE object is attached to the *MODEL_SPACE or *PAPER_SPACE block's extension dictionary under the name ACAD_SORTENTS. The  SORTENTSTABLE object related to this dictionary associates a different handle with each entity which redefines the order that the entities are regenerated.


XRECORD  [ACG]
DXF Group Codes

 OBJECTS Section

  XRECORD

The following group codes are common to all xrecord objects.

Xrecord group codes

Group codes	Description
100	Subclass marker (AcDbXrecord)
1-369 (except 5 and 105)	These values can be used by an application in any way.
Xrecord objects are used to store and manage arbitrary data. They are composed of DXF group codes with "normal object" groups, (that is, non-xdata group codes) ranging from 1 through 369 for supported ranges. This object is similar in concept to xdata but is not limited by size or order.

Xrecord objects are designed to work in such a way as to not offend releases R13c0 through R13c3. However, if read into a pre-R13c4 level of AutoCAD, xrecord objects disappear.


Advanced DXF Issues  [ACG]
DXF Group Codes

 Advanced DXF Issues

This section discusses the advanced concepts related to DXF group codes.

Topics in this section:

   Database Objects

   Persistent Inter-Object Reference Handles

   Subclass Markers

   Extension Dictionary and Persistent Reactors

   Extended Data

   Object Coordinate Systems (OCS)


Database Objects  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Database Objects

AutoCAD drawings consist largely of structured containers for database objects. Database objects each have the following:

Handle whose value is unique to the drawing/DXF file, and is constant for the lifetime of the drawing. This format has existed since AutoCAD Release 10, but as of AutoCAD Release 13, handles are always enabled.

Optional xdata table, just as entities have had since AutoCAD Release 11.

Optional persistent reactor table.

Optional ownership pointer to an extension dictionary, which in turn owns subobjects placed in it by an application.

Symbol tables and symbol table records are database objects and, thus, have a handle. They can also have xdata and persistent reactors in their DXF records.


Persistent Inter-Object Reference Handles  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Persistent Inter-Object Reference Handles

A set of group code ranges permit objects to directly specify references to other objects within the same drawing/DXF file. There are four ranges to go with the four types of relationships that can be specified:

Soft-pointer handle

Hard-pointer handle

Soft-owner handle

Hard-owner handle

These handle types are manifested as entity names in AutoLISP, as ads_name values in ADSRX and as like-named classes derived from ARX. These values are always maintained in insert, xref, and wblock operations such that references between objects in a set being copied are updated to point to the copied objects, while references to other objects remain unchanged.

Also, a group code range for "arbitrary" handles is defined to allow convenient storage of handle values that are not converted to entity names and then translated in insert, xref, or wblock.

Note  If you use 1005 xdata group codes to store handles, they are treated as soft-pointer handles, which means that when groups of objects are copied or are inserted into another drawing, references between the involved objects are translated. Although 1005 xdata items are always returned as handles in AutoLISP and ADSRX, all of the reference handle group code ranges are represented as "entity names" in AutoLISP and as ads_name structures in ADSRX.

Topics in this section:

   Pointer and Ownership References

   Hard and Soft

   Arbitrary Handles

   1005 Group Codes


Pointer and Ownership References  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Persistent Inter-Object Reference Handles

   Pointer and Ownership References

A pointer is a reference that indicates usage but not possession or responsibility for another object. Pointer references mean that the object uses the other object in some way, and shares access to it.

An ownership reference means that an owner object is responsible for the objects for which it has an owner handle. Ownership references direct the writing of the entire DWG and DXF files in a generic manner, such as beginning from a few key root objects, the writing of an owner handle.

An object can have any number of pointer references associated with it, but it can have only one owner.


Hard and Soft  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Persistent Inter-Object Reference Handles

   Hard and Soft

Hard references, whether they are pointer or owner, protect an object from being purged. Soft references do not.

In AutoCAD, block definitions and complex entities are hard owners of their elements. A symbol table and dictionaries are soft owners of their elements. Polyline entities are hard owners of their vertex and seqend entities. Insert entities are hard owners of their attrib and seqend entities.

When establishing a reference to another object, it is recommended that you think about whether the reference should protect an object from the PURGE command.


Arbitrary Handles  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Persistent Inter-Object Reference Handles

   Arbitrary Handles

Arbitrary handles are distinct in that they are not translated to session persistent identifiers internally, to entity names in AutoLISP, and so on. They are stored as handles. When translation of handle values are translated in drawing-merge operations, arbitrary handles are ignored.

In all environments, arbitrary handles can be exchanged for entity names of the current drawing by means of the handent functions. A common usage of arbitrary handles is to refer to objects in external DXF and DWG files.


1005 Group Codes  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Persistent Inter-Object Reference Handles

   1005 Group Codes

1005 xdata group codes have the same behavior and semantics as soft pointers, which means that they are translated whenever the host object is merged into a different drawing. However, 1005 items are not translated to session-persistent identifiers, internally entity names in AutoLISP and ADSRX. They are stored as handles.


Subclass Markers  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Subclass Markers

A big problem with filing a stream of group data is that a single object may be composed of several filer members, one for each level of inheritance where filing is done, which can be done by different developers. Because each level of inheritance can evolve separately, it is necessary to segregate the data of each class filer member from each other.

All class filer members are expected to precede their class-specific portion of instance data with a "subclass" marker--a 100 group code followed by a string with the actual name of the class. This does not affect the state needed to define the object's state, but it provides a means for the DXF file parsers to direct the group codes to the corresponding application software.

For example, an object which has data from different derived classes would be represented as follows:

999

FOOGRANDCHILD, defined by class AcDbSonOfSonOfFoo, which

999

 is derived from AcDbSonOfFoo

  0

FOOGRANDCHILD

  5

C2

100

AcDbFoo

999

Uses 10/20/30 group codes

 10

1.1

 20

2.3

 30

7.3

100

AcDbSonOfFoo

999

Also uses 10/20/30 group codes, for a different purpose

 10

1.1

 20

2.3

 30

7.3

100

AcDbSonOfSonOfFoo

999

Also uses 10/20/30 group codes, for yet another purpose

 10

13.2

 20

23.1

 30

31.2

999

Now for the Xdata

1001

APP_1

1070

45

1001

APP_2

1004

18A5B3EF2C199A


Extension Dictionary and Persistent Reactors  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Extension Dictionary and Persistent Reactors

The extension dictionary is an optional sequence that stores the handle of a dictionary object that belongs to the current object, which in turn may contain entries. This facility allows attachment of arbitrary database objects to any database object. Any object or entity may have this section.

Persistent reactors are an optional sequence that stores object handles of objects registering themselves as reactors on the current object. Any object or entity may have this section.


Extended Data  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Extended Data

Extended data is created by AutoLISP or ARX applications. If an entity contains extended data, it follows the entity's normal definition data. The group codes 1000 through 1071 describe extended data. The following is an example of an entity containing extended data in DXF format.

Normal entity definition data:

  0

INSERT

  5

F11

100

AcDbEntity

  8

TOP

100

AcDbBlockReference

 2

BLOCK_A

 10

0.0

 20

0.0

 30

0.0

Extended entity definition data:

1001

AME_SOL

1002

{

1070

 0

1071

 1.95059E+06

1070

 519

1010

2.54717

1020

2.122642

1030

2.049201

1005

ECD

1005

EE9

1005

0

1040

0.0

1040

1.0

1000

MILD_STEEL

The group code 1001 indicates the beginning of extended data. In contrast to normal entity data, with extended data the same group code can appear multiple times, and order is important.

Extended data are grouped by registered application name. Each registered application's group begins with a 1001 group code with the application name as the string value. Registered application names correspond to APPID symbol table entries.

An application can use as many APPID names as needed. APPID names are permanent, although they can be purged if they aren't currently used in the drawing. Each APPID name can have no more than one data group attached to each entity. Within an application's group, the sequence of extended data groups and their meaning is defined by the application.

The extended data group codes listed in the following table values as described:

Extended data group codes and descriptions

Entity name	Group code	Description
String	1000	Strings in extended data can be up to 255 bytes long (with the 256th byte reserved for the null character).
Application  name	1001 also a string value	Application names can be up to 31 bytes long (the 32nd byte is reserved for the null character). NOTE Do not add a 1001 group into your extended data because AutoCAD assumes it is the beginning of a new application extended data group.
Control string	1002	An extended data control string can be either "{"or "}". These braces enable applications to organize their data by subdividing the data into lists. The left brace begins a list, and the right brace terminates the most recent list. Lists can be nested. When AutoCAD reads the extended data for a particular application, it checks to ensure that braces are balanced.
Layer name	1003	Name of the layer associated with the extended data.
Binary data	1004	Binary data is organized into variable-length chunks. The maximum length of each chunk is 127 bytes. In ASCII DXF files, binary data is represented as a string of hexadecimal digits, two per binary byte.
Database  handle	1005	Handles of entities in the drawing database. NOTE When a drawing with handles and extended data handles is imported into another drawing using INSERT, INSERT *, XREF Bind, XBIND, or partial DXFIN, the extended data handles are translated in the same manner as their corresponding entity handles, thus maintaining their binding. This is also done in the EXPLODE block operation or for any other AutoCAD operation. When AUDIT detects an extended data handle that doesn't match the handle of an entity in the drawing file, it is considered an error. If AUDIT is fixing entities, it sets the handle to 0.
3 reals	1010, 1020, 1030	Three real values, in the order X, Y, Z. They can be used as a point or vector record. AutoCAD never alters their value.
World space  position	1011, 1021, 1031	Unlike a simple 3D point, the world space coordinates are moved, scaled, rotated, and mirrored along with the parent entity to which the extended data belongs. The world space position is also stretched when the STRETCH command is applied to the parent entity and this point lies within the select window.
World space  displacement	1012, 1022, 1032	Also a 3D point that is scaled, rotated, and mirrored along with the parent (but is not moved or stretched).
World direction	1013, 1023, 1033	Also a 3D point that is rotated and mirrored along with the parent  (but is not moved, scaled, or stretched).
Real	1040	A real value.
Distance	1041	A real value that is scaled along with the parent entity.
Scale factor	1042	Also a real value that is scaled along with the parent. The difference between a distance and a scale factor is application-defined.
Integer	1070	A 16-bit integer (signed or unsigned).
Long	1071	A 32-bit signed (long) integer.


Object Coordinate Systems (OCS)  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Object Coordinate Systems (OCS)

To save space in the drawing database (and in the DXF file), the points associated with each entity are expressed in terms of the entity's own object coordinate system (OCS). The OCS was referred to as ECS in previous releases of AutoCAD. With OCS, the only additional information needed to describe the entity's position in 3D space is the 3D vector describing the Z axis of the OCS, and the elevation value.

For a given Z axis (or extrusion) direction, there are an infinite number of coordinate systems, defined by translating the origin in 3D space and by rotating the X and Y axes around the Z axis. However, for the same Z axis direction, there is only one OCS. It has the following properties:

Its origin coincides with the WCS origin.

The orientation of the X and Y axes within the XY plane are calculated in an arbitrary but consistent manner. AutoCAD performs this calculation using the arbitrary axis algorithm (see "Arbitrary Axis Algorithm").

For some entities, the OCS is equivalent to the WCS and all points (DXF groups 10-37) are expressed in World coordinates. See the following table.

Coordinate systems associated with an entity type

Entities	Notes
3D entities such as line, point,  3dface, 3D polyline, 3D vertex, 3D mesh, 3D mesh vertex	These entities do not lie in a particular plane. All points are expressed in world coordinates. Of these entities, only lines and points can be extruded. Their extrusion direction can differ from the World Z axis.
2D entities such as circle, arc, solid, trace, text, attrib, attdef, shape, insert, 2D polyline, 2D vertex, lwpolyline, hatch, image	These entities are planar in nature. All points are expressed in object coordinates. All of these entities can be extruded. Their extrusion direction can differ from the World Z axis.
Dimension	Some of a dimension's points are expressed in WCS and some in OCS.
Viewport	Expressed in World coordinates.
Once AutoCAD has established the OCS for a given entity, the OCS works as follows:

The elevation value stored with an entity indicates how far to shift the XY plane along the Z axis (from the WCS origin) to make it coincide with the plane that contains the entity. How much of this is the user-defined elevation is unimportant.

Any 2D points entered through the UCS are transformed into the corresponding 2D points in the OCS, which is shifted and rotated with respect to the UCS.

These are a few ramifications of this process:

You cannot reliably find out what UCS was in effect when an entity was acquired.

When you enter the XY coordinates of an entity in a given UCS and then do a DXFOUT, you probably won't recognize those XY coordinates in the DXF file. You must know the method by which AutoCAD calculates the X and Y axes in order to work with these values.

The elevation value stored with an entity and output in DXF files is a sum of the Z-coordinate difference between the UCS XY plane and the OCS XY plane, and the elevation value that the user specified at the time the entity was drawn.

Topics in this section:

   Arbitrary Axis Algorithm


Arbitrary Axis Algorithm  [ACG]
DXF Group Codes

 Advanced DXF Issues

  Object Coordinate Systems (OCS)

   Arbitrary Axis Algorithm

The arbitrary axis algorithm is used by AutoCAD internally to implement the arbitrary but consistent generation of object coordinate systems for all entities which use object coordinates.

Given a unit-length vector to be used as the Z axis of a coordinate system, the arbitrary axis algorithm generates a corresponding X axis for the coordinate system. The Y axis follows by application of the right-hand rule.

The method is to examine the given Z axis (also called the normal vector) and see if it is close to the positive or negative World Z axis. If it is, cross the World Y axis with the given Z axis to arrive at the arbitrary X axis. If not, cross the World Z axis with the given Z axis to arrive at the arbitrary X axis. The boundary at which the decision is made was chosen to be both inexpensive to calculate and completely portable across machines. This is achieved by having a sort of "square" polar cap, the bounds of which is 1/64, which is precisely specifiable in six decimal-fraction digits and in six binary-fraction bits.

The algorithm does the following. (All vectors are assumed to be in 3D space and specified in the World Coordinate System).

Let the given normal vector be called N.

Let the world Y axis be called Wy, which is always (0,1,0).

Let the world Z axis be called Wz, which is always (0,0,1).

Here we are looking for the arbitrary X and Y axes to go with the normal N. They will be called Ax and Ay. N could also be called Az (the arbitrary Z axis) as follows:

If (abs (Nx) < 1/64) and (abs (Ny) < 1/64)  then

Ax = Wy X N  (where "X" is the cross-product operator).

Otherwise,

Ax = Wz X N.

Scale Ax to unit length.

The method of getting the Ay vector is

Ay = N X Ax.  Scale Ay to unit length.