Autocad 2002
Autocad 2002
GOVERNMENT USE
Use, duplication, or disclosure by the U. S. Governm ent is subject to restrictions as set forth in FAR 12.212 (C om mercial Computer Software-Restricted Rights) and DFA R 227.7202 (Rights in Technical Data and Com puter Software), as applicable.
1 2 3 4 5 6 7 8 9 10
Contents
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. .
.
.
1
.2
Chapter 1
DXF Format
.
. . . . .
.
. . . . .
.
. . . . .
.
. . . . .
.
. . . . . . . . . .
.
. . . . .
5
.6 .6 .6 .7 .9
Organization of This Reference . . . . . . Formatting Conventions in This Reference. Object and Entity Codes . . . . . . . . Group Code Value Types . . . . . . . . Group Codes in Numerical Order . . . . .
Chapter 2
HEADER Section .
.
. . .
.
. . .
.
. . .
.
. . .
.
. . . . . .
.
. . .
. 15
16 27 28
HEADER Section Group Codes . . . . . . Revised VPORT Header Variables . . . . Special Handling of Date/Time Variables .
Chapter 3
CLASSES Section .
.
. . . .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. . . .
.
. .
. 31
32 33
Chapter 4
TABLES Section .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. .
.
. . . .
.
. .
. 35
36 36
iii
Common Group Codes for Symbol Table Entries . APPID . . . . . . . . . . . . . . . . BLOCK_RECORD . . . . . . . . . . . . . DIMSTYLE . . . . . . . . . . . . . . . LAYER . . . . . . . . . . . . . . . . LTYPE . . . . . . . . . . . . . . . . STYLE . . . . . . . . . . . . . . . . UCS . . . . . . . . . . . . . . . . . VIEW . . . . . . . . . . . . . . . . VPORT . . . . . . . . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
37 38 39 40 44 45 46 47 49 51
Chapter 5
BLOCKS Section .
.
. . .
.
. . .
.
. . . . . .
.
. . .
.
. . .
.
. . .
.
. . .
.
. . .
.
. . .
.
. . .
.
. . . . . .
. 55
56 56 58
Chapter 6
ENTITIES Section .
.
. . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 59
60 62 63 63 64 65 66 68 69 69 69 71 72 73 74 75 76 76 77 78 80 83 83 85 86 88
Common Group Codes for Entities . . . . . . 3DFACE . . . . . . . . . . . . . . 3DSOLID . . . . . . . . . . . . . . ACAD_PROXY_ENTITY . . . . . . . . . . ARC . . . . . . . . . . . . . . . . ATTDEF . . . . . . . . . . . . . . . ATTRIB . . . . . . . . . . . . . . . BODY . . . . . . . . . . . . . . . CIRCLE . . . . . . . . . . . . . . . DIMENSION . . . . . . . . . . . . . Common Dimension Group Codes . . . . Aligned 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 . . . . . . . ELLIPSE . . . . . . . . . . . . . . . ELLIPSE Commands Parameter Option . . . HATCH . . . . . . . . . . . . . . . Boundary Path Data . . . . . . . . . Pattern Data . . . . . . . . . . . IMAGE . . . . . . . . . . . . . . . INSERT . . . . . . . . . . . . . . . LEADER. . . . . . . . . . . . . . . LINE . . . . . . . . . . . . . . . .
iv
Contents
LWPOLYLINE . . . MLINE. . . . . . MTEXT . . . . . OLEFRAME . . . . OLE2FRAME . . . . POINT . . . . . . POLYLINE . . . . Polyface Meshes . RAY . . . . . . REGION . . . . . SEQEND . . . . . SHAPE . . . . . . SOLID . . . . . . SPLINE . . . . . TEXT . . . . . . TOLERANCE . . . . TRACE. . . . . . VERTEX . . . . . VIEWPORT . . . . XLINE . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
. 88 . 89 . 92 . 93 . 94 . 96 . 97 . 98 . 99 . 99 100 100 101 102 103 105 106 107 109 113
Chapter 7
OBJECTS Section
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
. 115
116 116 116 117 118 119 120 121 122 124 125 125 126 127 128 128 131 132 133 135 136 137
OBJECT Section Group Codes . . Object Ownership . . . . Common Group Codes for Objects ACAD_PROXY_OBJECT . . . . ACDBDICTIONARYWDFLT . . . ACDBPLACEHOLDER . . . . . DICTIONARY . . . . . . . DICTIONARYVAR . . . . . . DIMASSOC . . . . . . . . GROUP . . . . . . . . . IDBUFFER . . . . . . . . IMAGEDEF . . . . . . . . IMAGEDEF_REACTOR. . . . . LAYER_INDEX . . . . . . . LAYER_FILTER . . . . . . . LAYOUT . . . . . . . . . MLINESTYLE. . . . . . . . OBJECT_PTR . . . . . . . . PLOTSETTINGS . . . . . . . RASTERVARIABLES. . . . . . SPATIAL_INDEX . . . . . . SPATIAL_FILTER . . . . . .
Contents
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
Chapter 8
THUMBNAILIMAGE Section .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
143
. 144
.
. . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . .
. 145
. . . . . . . . . . . . . . . . . . 146 146 147 147 148 148 149 149 152 153 153 154 154 156 158 159 162 163
ASCII DXF Files . . . . . . . . . . . General DXF File Structure . . . . . . Group Codes in DXF Files . . . . . . ASCII Control Characters in DXF Files Header Group Codes in DXF Files . . . Class Group Codes in DXF Files . . . . Symbol Table Group Codes in DXF Files . Symbol Table Example . . . . . Blocks Group Codes in DXF Files . . . . Entity Group Codes in DXF Files . . . . Object Group Codes in DXF Files . . . . Writing a DXF Interface Program . . . . Reading a DXF File . . . . . . Writing a DXF File . . . . . . Binary DXF Files . . . . . . . . . . . Slide Files . . . . . . . . . . . . . Old Slide Header . . . . . . . . . Slide Library Files. . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . .
.
. . . . . . . . . . .
. 165
. . . . . . . . . . . 166 166 167 167 167 168 168 170 170 173 175
Database Objects . . . . . . . . . . Persistent Inter-Object Reference Handles . . Pointer and Ownership References . . Hard and Soft References . . . . . Arbitrary Handles. . . . . . . . 1005 Group Codes . . . . . . . Subclass Markers . . . . . . . . . . Extension Dictionary and Persistent Reactors . Extended Data . . . . . . . . . . Object Coordinate Systems (OCS) . . . . Arbitrary Axis Algorithm . . . . . . .
Index
177
vi
Contents
This topic lists the revisions to the DXF Reference from the last update to the DXF Reference. The version number of this DXF Reference is u16.1.01. Any updates to this reference will be available at http:// www.autodesk.com/techpubs/autocad/dxf/.
In this chapter
s Objects Section
Objects Section
s
Objects Section
DXF Format
1
In this chapter
s Organization of This Reference s Object and Entity Codes s Group Code Value Types s Group Codes in Numerical
The DXF format is a tagged data representation of all the information contained in an AutoCAD drawing file. Tagged data means that each data element in the file is preceded by an integer number that is called a group code. A group codes value indicates what type of data element follows. This value 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.
Order
If the description is common to both DXF files and applications, no indicator is provided. Optional codes are indicated as optional in the description.
Chapter 1
DXF Format
Entities appear in both the BLOCK and ENTITIES sections of the DXF file. The use of group codes 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. Do not write programs that rely on 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. With each new AutoCAD release, new group codes will be added to entities to accommodate additional features.
Chapter 1
DXF Format
0 1 2 34 5 6 7 8
10
1118
48
49
5058
60
62 66 67
10
Chapter 1
DXF Format
102
105 110
111
112
170179 210
11
320329
330339
340349
350359
360369
370379
380389
12
Chapter 1
DXF Format
1000 1001
1010
13
14
Chapter 1
DXF Format
HEADER Section
2
In this chapter
s HEADER Section Group Codes
The group codes described in this chapter pertain only to DXF files. The HEADER section of a DXF file contains the settings of variables associated with the drawing. Each variable is specified by a 9 group code giving the variables name, followed by groups that supply the variables value. This chapter lists only the variables that are saved in the drawing file.
15
50 70 70 70 70 62
40 6 370 390
$CEPSNTYPE
380
$CHAMFERA $CHAMFERB
40 40
16
Chapter 2
HEADER Section
40 2 70 70 70 40 40 70
$DIMALTTZ
70
$DIMALTU
70
$DIMALTZ
70
$DIMAPOST
17
$DIMASZ $DIMATFIT
40 70
$DIMAUNIT
70
$DIMAZIN
70
1 1 1 40 70
$DIMCLRE
70
$DIMCLRT
70
$DIMDEC
70
$DIMDLE $DIMDLI
40 40
18
Chapter 2
HEADER Section
40 40 40
$DIMGAP $DIMJUST
40 70
1 40 70 70
$DIMLWD
70
$DIMLWE
70
1 40 70
19
$DIMSD2
70
70 70 70
70 2 70 70 40 70 70 40 70
$DIMTOFL
70
70 70 70
20
Chapter 2
HEADER Section
40 7 40 70
$DIMUPT
70
$DIMZIN
70
$DISPSILH
70
$DWGCODEPAGE
$ELEVATION $ENDCAPS
40 280
$EXTMAX $EXTMIN
21
40 70 2 5 1
$INSBASE $INSUNITS
10, 20, 30 70
$JOINSTYLE
280
70 10, 20 10, 20 40 70 70
22
Chapter 2
HEADER Section
$MAXACTVP $MEASUREMENT $MENU $MIRRTEXT $ORTHOMODE $PDMODE $PDSIZE $PELEVATION $PEXTMAX $PEXTMIN $PINSBASE $PLIMCHECK $PLIMMAX $PLIMMIN $PLINEGEN
40 70 70
23
$PSVPSCALE
40
$PUCSBASE
$PUCSORGBOTTOM
10, 20, 30
$PUCSORGFRONT
10, 20, 30
$PUCSORGLEFT
10, 20, 30
$PUCSORGRIGHT
10, 20, 30
$PUCSORGTOP
10, 20, 30
$PUCSORTHOREF
$PUCSORTHOVIEW
70
$PUCSXDIR $PUCSYDIR
24
Chapter 2
HEADER Section
$SHADEDIF $SKETCHINC $SKPOLY $SPLFRAME $SPLINESEGS $SPLINETYPE $SURFTAB1 $SURFTAB2 $SURFTYPE $SURFU $SURFV $TDCREATE
70 40 70 70 70 70 70 70 70 70 70 40
$TDINDWG
40
$TDUCREATE
40
$TDUPDATE
40
$TDUSRTIMER
40
25
40 7 40 70 40 70 2
$UCSORGBOTTOM
10, 20, 30
$UCSORGFRONT
10, 20, 30
$UCSORGLEFT
10, 20, 30
$UCSORGRIGHT
10, 20, 30
$UCSORGTOP
10, 20, 30
$UCSORTHOREF
26
Chapter 2
HEADER Section
70 40 70 2
$VISRETAIN
70
$WORLDVIEW
70
$XEDIT
290
27
the values in the VPORT table entries override the values of these header variables. Revised VPORT header variables
Variable $FASTZOOM $GRIDMODE $GRIDUNIT $SNAPANG $SNAPBASE $SNAPISOPAIR $SNAPMODE $SNAPSTYLE $SNAPUNIT $VIEWCTR $VIEWDIR $VIEWSIZE Group code 70 70 10, 20 50 10, 20 70 70 70 10, 20 10, 20 10, 20, 30 40 Description Fast zoom enabled if nonzero Grid mode on if nonzero Grid X and Y spacing Snap grid rotation angle Snap/grid base point (in UCS) Isometric plane: 0 = Left, 1 = Top, 2 = Right Snap mode on if nonzero Snap style: 0 = Standard, 1 = Isometric Snap grid X and Y spacing XY center of current view on screen Viewing direction (direction from target in WCS) Height of view
28
Chapter 2
HEADER Section
For example, on December 31, 1999, at 9:58:35 p.m. GMT, the DATE variable contains 2451544.91568287 The date and time are taken from the computers clock when the variable is read. The time is represented as a fraction of a day, do the times returned by DATE may be truly subtracted to compute differences in time. To extract the seconds since midnight from the value returned by DATE, use the AutoLISP expressions:
(setq s (getvar "DATE")) (setq seconds (* 86400.0 (- s (fix s))))
Note that DATE only returns a true Julian date if the systems clock is set to UTC/Zulu (Greenwich Mean Time). TDCREATE and TDUPDATE have the same format as DATE, but their values represent the creation time and last update time of the current drawing.
TDINDWG and TDUSRTIMER (and the $TDINDWG and $TDUSRTIMER DXF header variables) use a format similar to that of DATE, but their values represent elapsed times, as in:
YYYYMMDD.HHMMSShsec where: YYYY = year MM = month (01-12) DD = day (01-31) HH = hours (00-23) MM = minutes (00-59) SS = seconds (00-59) hsec = hundredths of a second (00-99) For example, if the current date is December 31, 1999, and the time is 9:58:35.75 p.m., CDATE would return the value: 19991231.21583575 Note that CDATE values can be compared for later and earlier values but that subtracting them yields numbers that are not meaningful.
29
30
CLASSES Section
3
In this chapter
s CLASSES Section Group Codes
The group codes described in this chapter 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.
31
90
280
281
32
Chapter 3
CLASSES Section
33
34
Chapter 3
CLASSES Section
TABLES Section
4
In this chapter
s Symbol Table Group Codes s Common Symbol Table Group
The group codes described in this chapter 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 ObjectARX applications in entity definition lists.
Codes
s APPID s BLOCK_RECORD s DIMSTYLE s LAYER s LTYPE s STYLE s UCS s VIEW s VPORT
35
36
Chapter 4
TABLES Section
37
APPID
The following group codes apply to APPID symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
38
Chapter 4
TABLES Section
70
BLOCK_RECORD
The following group codes apply to BLOCK_RECORD symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. BLOCK_RECORD group codes
Group codes 100 2 340 310 1001 Description Subclass marker (AcDbBlockTableRecord) Block name Hard-pointer ID/handle to associated LAYOUT object DXF: Binary data for bitmap preview (optional) Xdata application name ACAD (optional)
BLOCK_RECORD
39
1002
DIMSTYLE
The following group codes apply to DIMSTYLE symbol table entries. The DIMSTYLE system variables are described in appendix B, System Variables, in the Command Reference. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. DIMSTYLE group codes
Group codes 100 2 70 Description Subclass marker (AcDbDimStyleTableRecord) Dimension style name Standard flag values (bit-coded values): 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)
40
Chapter 4
TABLES Section
DIMSTYLE
41
42
Chapter 4
TABLES Section
DIMSTYLE
43
LAYER
The following group codes apply to LAYER symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. LAYER group codes
Group codes 100 2 70 Description Subclass marker (AcDbLayerTableRecord) Layer name Standard flags (bit-coded values): 1 = Layer is frozen; otherwise layer is thawed 2 = Layer is frozen by default in new viewports 4 = Layer is locked 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) Color number (if negative, layer is off) Linetype name Plotting flag. If set to 0, do not plot this layer Lineweight enum value Hard pointer ID/handle of PlotStyleName object
Xref-dependent layers are output during SAVEAS . For these layers, the associated linetype name in the DXF file is always CONTINUOUS.
44
Chapter 4
TABLES Section
LTYPE
The following group codes apply to LTYPE symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. LTYPE group codes
Group codes 100 2 70 Description Subclass marker (AcDbLinetypeTableRecord) Linetype name Standard flag values (bit-coded values): 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) Descriptive text for linetype Alignment code; value is always 65, the ASCII code for A The number of linetype elements Total pattern length Dash, dot or space length (one entry per element) 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
3 72 73 40 49 74
LTYPE
45
340 46 50
44 45 9
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
The following group codes apply to STYLE symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. STYLE group codes
Group codes 100 2 Description Subclass marker (AcDbTextStyleTableRecord) Style name
46
Chapter 4
TABLES Section
40 41 50 71
42 3 4
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
The following group codes apply to UCS symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
UCS
47
10
20, 30 11
21, 31 12
71
13
23, 33
48
Chapter 4
TABLES Section
Each 71/13,23,33 pair defines the UCS origin for a particular orthographic type relative to this UCS. For instance if the following pair is present, then invoking the UCS/LEFT command when UCSBASE is set to this UCS will cause the new UCS origin to become (1,2,3).
71: 13: 23: 33: 5 1.0 2.0 3.0
If this pair were not present, then invoking the UCS/LEFT command would cause the new UCS origin to be set to this UCSs origin point.
VIEW
The following group codes apply to VIEW symbol table entries. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. VIEW group codes
Group codes 100 2 70 Description Subclass marker (AcDbViewTableRecord) Name of view Standard flag values (bit-coded values): 1 = If set, this is a paper space view 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) View height (in DCS) View center point (in DCS) DXF: X value; APP: 2D point DXF: Y value of view center point (in DCS)
40 10
20
VIEW
49
21, 31 12
22, 32 42 43 44 50 71 281
The following codes only appear if code 72 is set to 1. They define the UCS that is associated to this view. This UCS will become the current UCS whenever this view is restored (if code 72 is 0, the UCS is unchanged).
50
Chapter 4
TABLES Section
122, 132 79
146 345
346
VPORT
The following group codes apply to VPORT symbol table entries. 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. In addition to the group codes described here, see Common Group Codes for Symbol Table Entries on
VPORT
51
page 37. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. VPORT group codes
Group codes 100 2 70 Description Subclass marker (AcDbViewportTableRecord) Viewport name Standard flag values (bit-coded values): 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) Lower-left corner of viewport DXF: X value; APP: 2D point DXF: Y value of lower-left corner of viewport Upper-right corner of viewport DXF: X value; APP: 2D point DXF: Y value of upper-right corner of viewport View center point (in DCS) DXF: X value; APP: 2D point DXF: Y value of view center point (in DCS) Snap base point DXF: X value; APP: 2D point DXF: Y value of snap base point Snap spacing X and Y DXF: X value; APP: 2D point DXF: Y value of snap spacing X and Y Grid spacing X and Y DXF: X value; APP: 2D point DXF: Y value of grid spacing X and Y
10
20 11
21 12
22 13
23 14
24 15
25
52
Chapter 4
TABLES Section
26, 36
17
27, 37 40 41 42 43 44 50 51 68 69 71 72 73 74 75 76 77 78
VPORT
53
110
122, 132 79
146 345
346
54
Chapter 4
TABLES Section
BLOCKS Section
5
In this chapter
s BLOCKS Section Group Codes s BLOCK s ENDBLK
The group codes described in this chapter are found in DXF files and used by applications. The BLOCKS section contains an entry for each block reference in the drawing.
55
BLOCK
The following group codes apply to block entities. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Block group codes
Group codes 0 5 102 Description Entity type (BLOCK) Handle Start of application-defined group {application_name. For example, {ACAD_REACTORS indicates the start of the AutoCAD persistent reactors group (optional) Codes and values within the 102 groups are application defined (optional) End of group, } (optional) Soft-pointer ID/handle to owner object
56
Chapter 5
BLOCKS Section
10
20, 30 3 1 4
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 Definitions Three empty definitions always appear in the BLOCKS section. They are titled *Model_Space, *Paper_Space and *Paper_Space0. These definitions manifest the representations of model space and paper space as block definitions internally. The internal name of the first paper space layout is
BLOCK
57
*Paper_Space, the second is *Paper_Space0, the third *Paper_Space1, and so on. Model Space and Paper Space Entity Segregation The interleaving between model space and paper space no longer occurs. Instead, all paper space entities are output, followed by model space entities. The flag distinguishing them is the group code 67.
ENDBLK
The following group codes apply to endblk objects. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Endblk group codes
Group codes 0 5 102 Description Entity type (ENDBLK) Handle Start of application-defined group {application_name. For example, {ACAD_REACTORS indicates the start of the AutoCAD persistent reactors group (optional) Codes and values within the 102 groups are application defined (optional) End of group, } (optional) Soft-pointer ID/handle to owner object Subclass marker (AcDbEntity) Layer name Subclass marker (AcDbBlockEnd)
58
Chapter 5
BLOCKS Section
ENTITIES Section
6
In this chapter
s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s s
Common Group Codes for Entities 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
This chapter 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 ObjectARX applications in entity definition lists.
59
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 may be changed 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. When a group is omitted, its default value upon input (when using OPEN) 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 SAVEAS). For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Group codes that apply to all graphical objects
Group code 1 Description APP: entity name (changes each time a drawing is opened) Entity type Handle Start of application defined group {application_name (optional) Codes and values within the 102 groups are application-defined (optional) End of group, } (optional) {ACAD_REACTORS indicates the start of the AutoCAD persistent reactors group. This group exists only if persistent reactors have been attached to this object (optional) If omitted, defaults to not omitted
0 5 102
no default
no default no default
60
Chapter 6
ENTITIES Section
102 102
no default no default
360
no default
102 330
100 67
not omitted 0
410 8 6
62
BYLAYER
370
not omitted
48 60
1.0 0
92
no default
61
3DFACE
The following group codes apply to 3dface entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. 3dface group codes
Group codes 100 10 Description Subclass marker (AcDbFace) First corner (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of first corner (in WCS) Second corner (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of second corner (in WCS) Third corner (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of third corner (in WCS) Fourth corner (in WCS). If only three corners are entered, this is the same as the third corner DXF: X value; APP: 3D point DXF: Y and Z values of fourth corner (in WCS) 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
20, 30 11
21, 31 12
22, 32 13
23, 33 70
62
Chapter 6
ENTITIES Section
3DSOLID
The following group codes apply to 3dsolid entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. 3dsolid group codes
Group codes 100 70 1 3 Description Subclass marker (AcDbModelerGeometry) Modeler format version number (currently = 1) Proprietary data (multiple lines < 255 characters each) Additional lines of proprietary data (if previous group 1 string is greater than 255 characters) (optional)
ACAD_PROXY_ENTITY
The following group codes apply to proxy entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Acad_proxy_entity group codes
Group codes 100 90 91 Description DXF: AcDbProxyEntity DXF: Proxy entity class ID (always 498) DXF: Application entitys 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 DXF: Size of graphics data in bytes DXF: Binary graphics data (multiple entries can appear) (optional)
92 310
3DSOLID
63
DXF: 0 (indicates end of object ID section) DXF: Object drawing format when it becomes a proxy (a 32-bit unsigned integer): Low word is AcDbDwgVersion High word is MaintenanceReleaseVersion DXF: Original custom object data format: 0 = DWG format 1 = DXF format
70
ARC
The following group codes apply to arc entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Arc group codes
Group codes 100 39 10 Description Subclass marker (AcDbCircle) Thickness (optional; default = 0) Center point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of center point (in OCS) Radius Subclass marker (AcDbArc) Start angle
20, 30 40 100 50
64
Chapter 6
ENTITIES Section
220, 230
ATTDEF
The following group codes apply to attdef (attribute definition) entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Attdef group codes
Group codes 100 39 10 Description Subclass marker (AcDbText) Thickness (optional; default = 0) First alignment point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of text start point (in OCS) Text height Default value (string) Subclass marker (AcDbAttributeDefinition) Text rotation (optional; default = 0) Relative X scale factor (width) (optional; default = 1). This value is also adjusted when fit-type text is used Oblique angle (optional; default = 0) Text style name (optional, default = STANDARD)
20, 30 40 1 100 50 41
51 7
ATTDEF
65
11
21, 31 210
73 74
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
The following group codes apply to attrib (attribute) entities. In addition to the group codes described here, see Common Group Codes for Entities on
66
Chapter 6
ENTITIES Section
page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Attrib group codes
Group codes 100 39 10 Description Subclass marker (AcDbText) Thickness (optional; default = 0) Text start point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of text start point (in OCS) Text height Default value (string) Subclass marker (AcDbAttribute) Attribute tag (string) 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) Field length (optional; default = 0) (not currently used) Text rotation (optional; default = 0) Relative X scale factor (width) (optional; default = 1). This value is also adjusted when fit-type text is used Oblique angle (optional; default = 0) Text style name (optional, default = STANDARD) Text generation flags (optional, default = 0). See TEXT group codes Horizontal text justification type (optional, default = 0). See TEXT group codes Vertical text justification type (optional, default = 0). See group code 73 in TEXT Alignment point (in OCS) (optional) DXF: X value; APP: 3D point Present only if 72 or 74 group is present and nonzero
20, 30 40 1 100 2 70
73 50 41
51 7 71 72
74
11
ATTRIB
67
220, 230
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
The following group codes apply to body entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Body group codes
Group codes 100 70 1 3 Description Subclass marker (AcDbModelerGeometry) Modeler format version number (currently = 1) Proprietary data (multiple lines < 255 characters each) Additional lines of proprietary data (if previous group 1 string is greater than 255 characters) (optional)
68
Chapter 6
ENTITIES Section
CIRCLE
The following group codes apply to circle entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Circle group codes
Group codes 100 39 10 Description Subclass marker (AcDbCircle) Thickness (optional; default = 0) Center point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of center point (in OCS) Radius Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector DXF: Y and Z values of extrusion direction (optional)
20, 30 40 210
220, 230
DIMENSION
Dimension entity definitions consist of group codes that are common to all dimension types, followed by codes specific to the type.
CIRCLE
69
on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Common dimension group codes
Group codes 100 2 Description Subclass marker (AcDbDimension) Name of the block that contains the entities that make up the dimension picture Definition point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point (in WCS) Middle point of dimension text (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of middle point of dimension text (in OCS) Dimension type. Values 06 are integer values that 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 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 Dimension text line spacing style (optional): 1 (or missing) = At least (taller characters will override) 2 = Exact (taller characters will not override) Dimension text line spacing factor (optional): Percentage of default (3-on-5) line spacing to be applied. Valid values range from 0.25 to 4.00 Actual measurement (optional; read-only value)
10
20, 30 11
21, 31 70
71
72
41
42
70
Chapter 6
ENTITIES Section
53
51
210
220, 230 3
Xdata belonging to the application ID "ACAD" follows a dimension entity if any dimension overrides that have been applied to this entity. See Dimension Style Overrides on page 76. For all dimension types, the following group codes represent 3D WCS points:
s s s s
(10, 20, 30) (13, 23, 33) (14, 24, 34) (15, 25, 35)
For all dimension types, the following group codes represent 3D OCS points:
s s s
DIMENSION
71
ties on page 60 and Common Dimension Group Codes on page 69 can also be present. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Aligned dimension group codes
Group codes 100 12 Description Subclass marker (AcDbAlignedDimension) Insertion point for clones of a dimensionBaseline and Continue (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of insertion point for clones of a dimension Baseline and Continue (in OCS) Definition point for linear and angular dimensions (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point for linear and angular dimensions (in WCS) Definition point for linear and angular dimensions (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point for linear and angular dimensions (in WCS)
22, 32
13
23, 33
14
24, 34
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.
72
Chapter 6
ENTITIES Section
and formatting used in this table, see Formatting Conventions in This Reference on page 6. Linear and rotated dimension group codes
Group codes 100 12 Description Subclass marker (AcDbAlignedDimension) Insertion point for clones of a dimensionBaseline and Continue (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of insertion point for clones of a dimension Baseline and Continue (in OCS) Definition point for linear and angular dimensions (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point for linear and angular dimensions (in WCS) Definition point for linear and angular dimensions (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point for linear and angular dimensions (in WCS) Angle of rotated, horizontal, or vertical dimensions 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 Subclass marker (AcDbRotatedDimension)
22, 32
13
23, 33
14
24, 34
50 52
100
DIMENSION
73
ting used in this table, see Formatting Conventions in This Reference on page 6. Radial and diameter dimension group codes
Group codes 100 15 Description Subclass marker (AcDbRadialDimension or AcDbDiametricDimension) Definition point for diameter, radius, and angular dimensions (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of definition point for diameter, radius, and angular dimensions (in WCS) Leader length for radius and diameter dimensions
25, 35
40
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.
23, 33
14
74
Chapter 6
ENTITIES Section
15
25, 35
16
26, 36
The points (13,23,33) and (14,24,34) specify the endpoints of the line used to determine the first extension line. 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.
DIMENSION
75
14
24, 34
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.
ELLIPSE
The following group codes apply to ellipse entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60.
76
Chapter 6
ENTITIES Section
For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Ellipse group codes
Group codes 100 10 Description Subclass marker (AcDbEllipse) Center point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of center point (in WCS) Endpoint of major axis, relative to the center (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of endpoint of major axis, relative to the center (in WCS) Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector DXF: Y and Z values of extrusion direction (optional) Ratio of minor axis to major axis Start parameter (this value is 0.0 for a full ellipse) End parameter (this value is 2pi for a full ellipse)
20, 30 11
21, 31
210
220, 230 40 41 42
The group codes 41 and 42 are the start and end values for u in the equation describing the Parameter option of the ELLIPSE command (see the following topic, ELLIPSE Commands Parameter Option). 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.
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
ELLIPSE
77
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
s s s s s
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 generates the start point at 2,2 and the end point at 0,1 and fills in the ellipse from 2,2 to 0,1 in a counterclockwise direction.
HATCH
The following group codes apply to hatch entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60.
78
Chapter 6
ENTITIES Section
For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Hatch group codes
Group codes 100 10 Description Subclass marker (AcDbHatch) Elevation point (in OCS) DXF: X value = 0; APP: 3D point (X and Y always equal 0, Z represents the elevation) DXF: Y and Z values of elevation point (in OCS) Y value = 0, Z represents the elevation Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector DXF: Y and Z values of extrusion direction Hatch pattern name Solid fill flag (solid fill = 1; pattern fill = 0) Associativity flag (associative = 1; non-associative = 0) Number of boundary paths (loops) Boundary path data. Repeats number of times specified by code 91. See Boundary Path Data on page 80 Hatch style: 0 = Hatch odd parity area (Normal style) 1 = Hatch outermost area only (Outer style) 2 = Hatch through entire area (Ignore style) Hatch pattern type: 0 = User-defined; 1 = Predefined; 2 = Custom Hatch pattern angle (pattern fill only) Hatch pattern scale or spacing (pattern fill only) Hatch pattern double flag (pattern fill only): 0 = not double; 1 = double Number of pattern definition lines
20, 30
210
75
76
52 41 77
78
HATCH
79
47
98 10
20
varies
93
72
varies
97
80
Chapter 6
ENTITIES Section
20 42
20 11
21
20 40
HATCH
81
20 11
21 40 50 51 73
82
Chapter 6
ENTITIES Section
20 42
Pattern Data
The following pattern data codes repeat for each pattern definition line. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Hatch pattern data group codes
Group codes 53 43 44 45 46 79 49 Description Pattern line angle Pattern line base point, X component Pattern line base point, Y component Pattern line offset, X component Pattern line offset, Y component Number of dash length items Dash length (multiple entries)
IMAGE
The following group codes apply to image entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60.
IMAGE
83
For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Image group codes
Group codes 100 90 10 Description Subclass marker (AcDbRasterImage) Class version Insertion point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of insertion point (in WCS) U-vector of a single pixel (points along the visual bottom of the image, starting at the insertion point) (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values U-vector (in WCS) V-vector of a single pixel (points along the visual left side of the image, starting at the insertion point) (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of V-vector (in WCS) Image size in pixels DXF: U value; APP: 2D point (U and V values) DXF: V value of image size in pixels Hard reference to imagedef object Image display properties: 1 = Show image 2 = Show image when not aligned with screen 4 = Use clipping boundary 8 = Transparency is on Clipping state: 0 = Off, 1 = On Brightness value (0-100; default = 50) Contrast value (0-100; default = 50) Fade value (0-100; default = 0)
20, 30 11
21, 31 12
22, 32 13
23 340 70
84
Chapter 6
ENTITIES Section
24
INSERT
The following group codes apply to insert (block reference) entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Insert group codes
Group codes 100 66 Description Subclass marker (AcDbBlockReference) 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 Block name Insertion point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of insertion point (in OCS) X scale factor (optional; default = 1)
2 10
20, 30 41
INSERT
85
220, 230
LEADER
The following group codes apply to leader entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Leader group codes
Group codes 100 3 71 72 73 Description Subclass marker (AcDbLeader) Dimension style name Arrowhead flag: 0 = Disabled; 1 = Enabled Leader path type: 0 = Straight line segments; 1 = Spline 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
86
Chapter 6
ENTITIES Section
75 40 41 76 10
20, 30 77 340
210
223, 233
Xdata belonging to the application ID "ACAD" follows a leader entity if any dimension overrides have been applied to this entity. See Dimension Style Overrides on page 76.
LEADER
87
LINE
The following group codes apply to line entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Line group codes
Group codes 100 39 10 Description Subclass marker (AcDbLine) Thickness (optional; default = 0) Start point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of start point (in WCS) End point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of end point (in WCS) Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector DXF: Y and Z values of extrusion direction (optional)
20, 30 11
21, 31 210
220, 230
LWPOLYLINE
The following group codes apply to lwpolyline entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
88
Chapter 6
ENTITIES Section
43
38 39 10
20
40
41
42
210
220, 230
MLINE
The following group codes apply to mline entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
MLINE
89
340 40 70 71
72 73 10
20, 30 210
220, 230 11
21, 31 12
22, 32
13
90
Chapter 6
ENTITIES Section
41 75
42
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 elements path intersects the miter vector. The next group code 41 value is the distance along the line elements 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.
MLINE
91
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
The following group codes apply to mtext entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Mtext group codes
Group codes 100 10 Description Subclass marker (AcDbMText) Insertion point DXF: X value; APP: 3D point DXF: Y and Z values of insertion point Nominal (initial) text height Reference rectangle width 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 Drawing direction: 1 = Left to right; 3 = Top to bottom; 5 = By style (the flow direction is inherited from the associated text style) 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 Additional text (always in 250 character chunks) (optional) Text style name (STANDARD if not provided) (optional)
20, 30 40 41 71
72
3 7
92
Chapter 6
ENTITIES Section
220, 230 11
21, 31 42
43 50 73
44
Xdata with the "DCO15" application ID may follow an mtext entity. This contains information related to the dbConnect feature.
OLEFRAME
The following group codes apply to oleframe entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
OLEFRAME
93
OLE2FRAME
The following group codes apply to ole2frame entities. This information is read-only. During OPEN, the values are ignored because they are part of the OLE binary object, and are obtained via access functions. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Ole2frame group codes
Group codes 100 70 3 10 Description Subclass marker (AcDbOle2Frame) OLE version number Length of binary data Upper left corner (WCS) DXF: X value; APP: 3D point DXF: Y and Z values of upper left corner (in WCS) Lower right corner (WCS) DXF: X value; APP: 3D point DXF: Y and Z values of lower right corner (in WCS) OLE object type, 1 = Link, 2 = Embedded, 3 = Static
20, 30 11
21, 31 71
94
Chapter 6
ENTITIES Section
90 310 1
OLE2FRAME
95
POINT
The following group codes apply to point entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Point group codes
Group codes 100 10 Description Subclass marker (AcDbPoint) Point location (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of point location (in WCS) Thickness (optional; default = 0) Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector DXF: Y and Z values of extrusion direction (optional) Angle of the X axis for the UCS in effect when the point was drawn (optional, default = 0); used when PDMODE is nonzero
20, 30 39 210
220, 230 50
96
Chapter 6
ENTITIES Section
POLYLINE
The following group codes apply to polyline entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Polyline group codes
Group codes 100 66 10 Description Subclass marker (AcDb2dPolyline or AcDb3dPolyline) Obsolete; formerly an entities follow flag (optional; ignore if present) DXF: always 0 APP: a dummy point; the X and Y values are always 0, and the Z value is the polylines elevation (in OCS when 2D, WCS when 3D) DXF: always 0 DXF: polylines elevation (in OCS when 2D, WCS when 3D) Thickness (optional; default = 0) 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 Default start width (optional; default = 0) Default end width (optional; default = 0) Polygon mesh M vertex count (optional; default = 0) Polygon mesh N vertex count (optional; default = 0) Smooth surface M density (optional; default = 0) Smooth surface N density (optional; default = 0)
20 30 39 70
40 41 71 72 73 74
POLYLINE
97
210
220, 230
Xdata with the "AUTOCAD_POSTSCRIPT_FIGURE" application ID may follow a polyline entity. This contains information related to PostScript images and PostScript fill information.
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
98
Chapter 6
ENTITIES Section
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
The following group codes apply to ray entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Ray group codes
Group codes 100 10 Description Subclass marker (AcDbRay) Start point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of start point (in WCS) Unit direction vector (in WCS) DXF: X value; APP: 3D vector DXF: Y and Z values of unit direction vector (in WCS)
20, 30 11
21, 31
REGION
The following group codes apply to region entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Region group codes
Group codes 100 70 Description Subclass marker (AcDbModelerGeometry) Modeler format version number (currently = 1)
RAY
99
SEQEND
The following group codes apply to seqend entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Seqend group codes
Group codes 2 Description 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
The following group codes apply to shape entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Shape group codes
Group codes 100 39 10 Description Subclass marker (AcDbShape) Thickness (optional; default = 0) Insertion point (in WCS) DXF: X value; APP: 3D point
100
Chapter 6
ENTITIES Section
220, 230
SOLID
The following group codes apply to solid entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Solid group codes
Group codes 100 10 Description Subclass marker (AcDbTrace) First corner DXF: X value; APP: 3D point DXF: Y and Z values of first corner Second corner DXF: X value; APP: 3D point DXF: Y and Z values of second corner Third corner XF: X value; APP: 3D point
20, 30 11
21, 31 12
SOLID
101
23, 33 39 210
220, 230
SPLINE
The following group codes apply to spline entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Spline group codes
Group codes 100 210 Description Subclass marker (AcDbSpline) Normal vector (omitted if the spline is nonplanar) DXF: X value; APP: 3D vector DXF: Y and Z values of normal vector (optional) Spline flag (bit coded): 1 = Closed spline 2 = Periodic spline 4 = Rational spline 8 = Planar 16 = Linear (planar bit is also set) Degree of the spline curve
220, 230 70
71
102
Chapter 6
ENTITIES Section
22, 32 13
23, 33 40 41 10
20, 30
11
21, 31
TEXT
The following group codes apply to text entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60.
TEXT
103
For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Text group codes
Group codes 100 39 10 Description Subclass marker (AcDbText) Thickness (optional; default = 0) First alignment point (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of first alignment point (in OCS) Text height Default value (the string itself) Text rotation (optional; default = 0) Relative X scale factorwidth (optional; default = 1) This value is also adjusted when fit-type text is used Oblique angle (optional; default = 0) Text style name (optional, default = STANDARD) Text generation flags (optional, default = 0): 2 = Text is backward (mirrored in X) 4 = Text is upside down (mirrored in Y) 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 Group 72 and 73 integer codes table for clarification Second alignment point (in OCS) (optional) 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) DXF: Y and Z values of second alignment point (in OCS) (optional) Extrusion direction (optional; default = 0, 0, 1) DXF: X value; APP: 3D vector
20, 30 40 1 50 41
51 7 71
72
11
21, 31 210
104
Chapter 6
ENTITIES Section
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 3 (top) 2 (middle) 1 (bottom) 0 (baseline) Group 72 0 TLeft MLeft BLeft Left 1 TCenter MCenter BCenter Center 2 TRight MRight BRight Right Aligned Middle Fit 3 4 5
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
The following group codes apply to tolerance entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
TOLERANCE
105
20, 30 1 210
220, 230 11
21, 31
TRACE
The following group codes apply to trace entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Trace group codes
Group codes 100 10 Description Subclass marker (AcDbTrace) First corner (in OCS) DXF: X value; APP: 3D point DXF: Y and Z values of first corner (in OCS) Second corner (in OCS) DXF: X value; APP: 3D point
20, 30 11
106
Chapter 6
ENTITIES Section
22, 32 13
23, 33 39 210
220, 230
VERTEX
The following group codes apply to vertex entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Vertex group codes
Group codes 100 100 10 Description Subclass marker (AcDbVertex) Subclass marker (AcDb2dVertex or AcDb3dPolylineVertex) Location point (in OCS when 2D, and WCS when 3D) DXF: X value; APP: 3D point DXF: Y and Z values of location point (in OCS when 2D, and WCS when 3D) Starting width (optional; default is 0)
20, 30
40
VERTEX
107
70
50 71 72 73 74
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
108
Chapter 6
ENTITIES Section
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
The following group codes apply to viewport entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Viewport group codes
Group codes 100 10 Description Subclass marker (AcDbViewport) Center point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of center point (in WCS) Width in paper space units Height in paper space units 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 Viewport ID View center point (in DCS) DXF: X value; APP: 2D point DXF: View center point Y value (in DCS)
20, 30 40 41 68
69 12
22
VIEWPORT
109
23 14
24 15
25 16
26, 36 17
27, 37 42 43 44 45 50 51 72 341
110
Chapter 6
ENTITIES Section
340
1 281
VIEWPORT
111
346
79
146
112
Chapter 6
ENTITIES Section
XLINE
The following group codes apply to xline entities. In addition to the group codes described here, see Common Group Codes for Entities on page 60. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. Xline group codes
Group codes 100 10 Description Subclass marker (AcDbXline) First point (in WCS) DXF: X value; APP: 3D point DXF: Y and Z values of first point (in WCS) Unit direction vector (in WCS) DXF: X value; APP: 3D vector DXF: Y and Z values of unit direction vector (in WCS)
20, 30 11
21, 31
XLINE
113
114
Chapter 6
ENTITIES Section
OBJECTS Section
7
In this chapter
s OBJECT Section Group Codes s Common Group Codes for
This chapter 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 ObjectARX applications in entity definition lists.
Objects
s ACAD_PROXY_OBJECT s ACDBDICTIONARYWDFLT s ACDBPLACEHOLDER s DICTIONARY s DICTIONARYVAR s DIMASSOC s GROUP s IDBUFFER s IMAGEDEF s IMAGEDEF_REACTOR s LAYER_INDEX s LAYER_FILTER s LAYOUT s MLINESTYLE s OBJECT_PTR s PLOTSETTINGS s RASTERVARIABLES s SPATIAL_INDEX s SPATIAL_FILTER s SORTENTSTABLE s VLA_PROJECT s XRECORD
115
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 ObjectARX 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.
116
Chapter 7
OBJECTS Section
ACAD_PROXY_OBJECT
The following group codes apply to ACAD_PROXY_OBJECT objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
ACAD_PROXY_OBJECT
117
DXF: 0 (indicates end of object ID section) DXF: Object drawing format when it becomes a proxy (a 32-bit unsigned integer): Low word is AcDbDwgVersion High word is MaintenanceReleaseVersion DXF: Original custom object data format: 0 = DWG format 1 = DXF format
70
The 92 field is not used for AcDbProxyObject. Objects of this class never have graphics.
ACDBDICTIONARYWDFLT
The following group codes are used by ACDBDICTIONARYWDFLT objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
118
Chapter 7
OBJECTS Section
ACDBPLACEHOLDER
The following group codes are used by the ACDBPLACEHOLDER objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
ACDBPLACEHOLDER
119
DICTIONARY
The following group codes are used by DICTIONARY objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. DICTIONARY group codes
Group codes 0 5 102 330 102 330 100 280 Description Object name (DICTIONARY) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always } Soft-pointer ID/handle to owner object Subclass marker (AcDbDictionary) Hard owner flag. If set to 1, indicates that elements of the dictionary are to be treated as hard owned
120
Chapter 7
OBJECTS Section
3 350
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. The prefix "ACAD_" is reserved for use by AutoCAD applications.
DICTIONARYVAR
The following group codes are used by DICTIONARYVAR objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. DICTIONARYVAR group codes
Group codes 0 5 102 330 Description Object name (DICTIONARYVAR) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary (ACDBVARIABLEDICTIONARY) End of persistent reactors group, always }
102
DICTIONARYVAR
121
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.
DIMASSOC
The following group codes are used by DIMASSOC objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. DIMASSOC group codes
Group codes 0 5 102 330 100 330 Description Object name (DIMASSOC) Handle Persistent reactors group; always {ACAD_REACTORS} Soft-pointer ID Subclass marker (AcDbDimAssoc) ID of dimension object
122
Chapter 7
OBJECTS Section
DIMASSOC objects implement associative dimensions by specifying an association between a dimension object and drawing geometry objects. An
DIMASSOC
123
associative dimension is a dimension that will automatically update when the associated geometry is modified.
GROUP
The following group codes are used by GROUP objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. GROUP group codes
Group codes 0 5 102 Description Object name (GROUP) Handle Start of persistent reactors group; always {ACAD_REACTORS (persistent reactors group appears in all dictionaries except the main dictionary) Soft-pointer ID/handle to owner dictionary. For GROUP objects this is always the ACAD_GROUP entry of the named object dictionary End of persistent reactors group, always } Soft-pointer ID/handle to owner object Subclass marker (AcDbGroup) Group description Unnamed flag: 1 = Unnamed; 0 = Named Selectability flag: 1 = Selectable; 0 = Not selectable Hard-pointer handle to entity in group (one entry per object)
330
124
Chapter 7
OBJECTS Section
IDBUFFER
The following group codes are used by IDBUFFER objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. IDBUFFER group codes
Group codes 100 330 Description Subclass marker (AcDbIdBuffer) 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
The following group codes are used by IMAGEDEF objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
IDBUFFER
125
102 100 90 1 10
20 11
12 280 281
IMAGEDEF_REACTOR
The following group codes are used by IMAGEDEF_REACTOR objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
126
Chapter 7
OBJECTS Section
LAYER_INDEX
The following group codes are used by LAYER_INDEX objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. LAYER_INDEX group codes
Group codes 0 5 102 330 102 100 40 100 8 360 90 Description Object name (LAYER_INDEX) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always } Subclass marker (AcDbIndex) Time stamp (Julian date) Subclass marker (AcDbLayerIndex) Layer name (multiple entries may exist) Hard owner reference to IDBUFFER (multiple entries may exist) Number of entries in the IDBUFFER list (multiple entries may exist)
LAYER_INDEX
127
LAYER_FILTER
The following group codes are used by LAYER_FILTER objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. LAYER_FILTER group codes
Group codes 0 5 102 330 102 100 100 8 Description Object name (LAYER_FILTER) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always } Subclass marker (AcDbFilter) Subclass marker (AcDbLayerFilter) Layer name (multiple entries may exist)
LAYOUT
The following group codes are used by LAYOUT objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. LAYOUT group codes
Group codes 0 5 Description Object name (LAYOUT) Handle
128
Chapter 7
OBJECTS Section
plotsettings object For group codes and descriptions following the AcDbPlotSettings group codes marker, see PLOTSETTINGS on page 133 100 1 70 Subclass marker (AcDbLayout) Layout name Flag (bit-coded) to control the following: 1 = Indicates the PSLTSCALE value for this layout when this layout is current 2 = Indicates the LIMCHECK value for this layout when this layout is current Tab order. This number is an ordinal indicating this layouts ordering in the tab control that is attached to the AutoCAD drawing frame window. Note that the Model tab always appears as the first tab regardless of its tab order Minimum limits for this layout (defined by LIMMIN while this layout is current) DXF: X value; APP: 2D point DXF: Y value of minimum limits Maximum limits for this layout (defined by LIMMAX while this layout is current): DXF: X value; APP: 2D point DXF: Y value of maximum limits Insertion base point for this layout (defined by INSBASE while this layout is current): DXF: X value; APP: 3D point DXF: Y and Z values of the insertion base point
71
10
20 11
21 12
22, 32
LAYOUT
129
24, 34 15
25, 35 146 13
23, 33 16
26, 36 17
27, 37 76
330 331
345
346
130
Chapter 7
OBJECTS Section
MLINESTYLE
The following group codes are used by MLINESTYLE objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. MLINESTYLE group codes
Group codes 0 5 102 Description Object name (MLINESTYLE) Handle Start of persistent reactors group; always {ACAD_REACTORS (persistent reactors group appears in all dictionaries except the main dictionary) Soft-pointer ID/handle to owner dictionary. For MLINESTYLE objects this is always the ACAD_MLINESTYLE entry of the named object dictionary End of persistent reactors group; always } Subclass marker (AcDbMlineStyle) Mline style name 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 Style description (string, 255 characters maximum) Fill color (integer, default = 256) Start angle (real, default is 90 degrees) End angle (real, default is 90 degrees) Number of elements
330
102 100 2 70
3 62 51 52 71
MLINESTYLE
131
62
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 Mlinestyle The 340 group in the same object, which indicates the proper MLINESTYLE object. 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
The following group codes are used by OBJECT_PTR objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. OBJECT_PTR group codes
Group codes 0 5 102 330 102 Description Object name (OBJECT_PTR) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always }
132
Chapter 7
OBJECTS Section
PLOTSETTINGS
The following group codes are used by PLOTSETTINGS objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. PLOTSETTINGS group codes
Group codes 0 5 102 330 102 330 100 1 2 4 6 40 41 42 43 Description Object name (PLOTSETTINGS) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always } Soft-pointer ID/handle to owner object Subclass marker (AcDbPlotSettings) Page Setup name Name of system printer or plot configuration file Paper size Plot view name Size, in millimeters, of unprintable margin on the left side of the paper Size, in millimeters, of unprintable margin on the bottom of the paper Size, in millimeters, of unprintable margin on the right side of the paper Size, in millimeters, of unprintable margin on the top of the paper
PLOTSETTINGS
133
72
73
134
Chapter 7
OBJECTS Section
7 75
147
148 149
RASTERVARIABLES
The following group codes are used by RASTERVARIABLES objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. RASTERVARIABLES group codes
Group codes 0 5 102 Description Object name (RASTERVARIABLES) Handle Start of persistent reactors group; always {ACAD_REACTORS
RASTERVARIABLES
135
102 100 90 70 71 72
SPATIAL_INDEX
The following group codes are used by SPATIAL_INDEX objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. SPATIAL_INDEX group codes
Group codes 0 5 102 330 102 100 Description Object name (SPATIAL_INDEX) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary End of persistent reactors group, always } Subclass marker (AcDbIndex)
136
Chapter 7
OBJECTS Section
The SPATIAL_INDEX is always written out empty to a DXF file. This object can be ignored.
SPATIAL_FILTER
The following group codes are used by SPATIAL_FILTER objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6. SPATIAL_FILTER group codes
Group codes 0 5 102 330 102 100 100 70 Description Object name (SPATIAL_FILTER) Handle Start of persistent reactors group; always {ACAD_REACTORS Soft-pointer ID/handle to owner dictionary (SPATIAL) End of persistent reactors group, always } Subclass marker (AcDbFilter) Subclass marker (AcDbSpatialFilter) Number of points on the clip boundary 2 = Rectangular clip boundary (lower-left and upper-right) greater than 2 = Polyline clip boundary Clip boundary definition point (in OCS) (always 2 or more) based on an xref scale of 1 DXF: X value; APP: 2D point DXF: Y value of boundary definition point (always 2 or more)
10
20
SPATIAL_FILTER
137
220, 230 11
21, 31
71
72 40 73 41 40
40
SORTENTSTABLE
The following group codes are used by SORTENTSTABLE objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
138
Chapter 7
OBJECTS Section
331 5
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 blocks 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.
VBA_PROJECT
The following group codes are used by VBA_PROJECT objects. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
VBA_PROJECT
139
310
XRECORD
The following group codes are common to all xrecord objects. In addition to the group codes described here, see Common Group Codes for Objects on page 116. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference on page 6.
140
Chapter 7
OBJECTS Section
1369 (except 5 These values can be used by an application in any way and 105)
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.
XRECORD
141
142
Chapter 7
OBJECTS Section
THUMBNAILIMAGE Section
8
In this chapter
s THUMBNAILIMAGE Section
This chapter presents the group codes that are found in the THUMBNAILIMAGE section of a DXF file. This section exists only if a preview image has been saved with the DXF file.
Group Codes
143
310
144
Chapter 8
THUMBNAILIMAGE Section
A
In this chapter
s ASCII DXF Files s Binary DXF Files s Slide Files s Slide Library Files
This appendix describes the various file formats AutoCAD uses to interchange drawing data with other applications. The formats presented are Drawing Interchange File (DXF), binary DXF, Slide (SLD), and the Slide Library (SLB) file formats. DXF files can be either ASCII or binary formats. Because ASCII DXF files are more common than the binary format, the term DXF file is used to refer to ASCII DXF files and the term binary DXF file is used for the binary format.
145
HEADER section. Contains general information about the drawing. 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. 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)
146
Appendix A
BLOCKS section. Contains block definition and drawing entities that make up each block reference in the drawing. ENTITIES 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. THUMBNAILIMAGE section. Contains the preview image data for of the drawing. This section is optional.
If you use the Select Objects option of the SAVE and SAVEAS commands, 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.
147
contains a caret character, it is expanded to caret, space (^ ). OPEN and INSERT perform the complementary conversion.
148
Appendix A
0 Table entry data, repeats, for each table record <table type> 5 <handle> 100 AcDbSymbolTableRecord . . <data> . 0 ENDTAB 0 ENDSEC
Indicates a symbol table entry Text style symbol table entry. Exception to rule that code 0 fully defines type
149
5 1C 70 3 1001 APP_X 1040 42.0 0 STYLE 5 3A 2 ENTRY_1 70 64 40 .4 41 1.0 50 0.0 71 0 42 0.4 3 BUFONTS.TXT
STYLE table handle; same as for entities and other objects Maximum number of STYLE table records to follow (pre-Release 13 field) APP_X has put xdata on a symbol table Just a single floating-point number Beginning of first element in the STYLE symbol table The first entrys handle (DIMSTYLE entries will have 105 here) The first entrys text name Standard flag values Text height Width scale factor Oblique angle Text generation flags Last height used Primary font file name
150
Appendix A
0 STYLE 5 C2 2 ENTRY_2 ... ... 3 BUFONTS.TXT 102 {ACAD_REACTORS 330 3C2 330 41B 102 } 1001 APP_1 1070 45 1001 APP_2 1004 18A5B3EF2C199A 0 UCS
Second entry begins. No xdata or persistent reactors on first entry Second entry handle Second entry text name Other fields down to group code 3 Primary font file name and last object typespecific group This entry has two persistent reactors Soft ID to first reactor object Soft ID to first reactor object Indicates the end of the reactor set Xdata attached to this entry
151
152
Appendix A
153
154
Appendix A
' ReadDXF extracts specified code/value pairs from a DXF file. ' This function requires four string parameters, a valid DXF ' file name, a DXF section name, the name of an object in that ' section, and a comma delimited list of codes. ' Function ReadDXF( _ ByVal dxfFile As String, ByVal strSection As String, _ ByVal strObject As String, ByVal strCodeList As String) Dim tmpCode, lastObj As String Open dxfFile For Input As #1 ' Get the first code/value pair codes = ReadCodes ' Loop through the whole file until the "EOF" line While codes(1) <> "EOF" ' If the group code is '0' and the value is 'SECTION' .. If codes(0) = "0" And codes(1) = "SECTION" Then ' This must be a new section, so get the next ' code/value pair. codes = ReadCodes() ' If this section is the right one .. If codes(1) = strSection Then ' Get the next code/value pair and .. codes = ReadCodes ' Loop through this section until the 'ENDSEC' While codes(1) <> "ENDSEC" ' While in a section, all '0' codes indicate ' an object. If you find a '0' store the ' object name for future use. If codes(0) = "0" Then lastObj = codes(1) ' If this object is one you're interested in If lastObj = strObject Then ' Surround the code with commas tmpCode = "," & codes(0) & "," ' If this code is in the list of codes .. If InStr(strCodeList, tmpCode) Then ' Append the return value. ReadDXF = ReadDXF & _ codes(0) & "=" & codes(1) & vbCrLf End If End If ' Read another code/value pair codes = ReadCodes Wend End If Else codes = ReadCodes End If Wend Close #1 End Function ' ' ' ' ' ReadCodes reads two lines from an open file and returns a two item array, a group code and its value. As long as a DXF file is read two lines at a time, all should be fine. However, to make your code more reliable, you should add some additional error and sanity checking.
155
' Function ReadCodes() As Variant Dim codeStr, valStr As String Line Input #1, codeStr Line Input #1, valStr ' Trim the leading and trailing space from the code ReadCodes = Array(Trim(codeStr), valStr) End Function
s s s s
The entire HEADER section can be omitted if you dont set header variables. Any of the tables in the TABLES section can be omitted if you dont 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 havent 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.
156
Appendix A
The following Visual Basic subroutine constructs a DXF file representing a polygon.
' WriteDXFPolygon creates a minimal DXF file that only contains ' the ENTITIES section. This subroutine requires five parameters, ' the DXF file name, the number of sides for the polygon, the X ' and Y coordinates for the bottom end of the right-most side ' (it starts in a vertical direction), and the length for each ' side. Note that because this only requests 2D points, it does ' not include the Z coordinates (codes 30 and 31). The lines are ' placed on the layer "Polygon." ' Sub WriteDXFPolygon( _ dxfFile As String, iSides As Integer, _ dblX As Double, dblY As Double, dblLen As Double) Dim i As Integer Dim dblA1, dblA, dblPI, dblNX, dblNY As Double Open dxfFile For Output As #1 Print #1, 0 Print #1, "SECTION" Print #1, 2 Print #1, "ENTITIES" dblPI = Atn(1) * 4 dblA1 = (2 * dblPI) / iSides dblA = dblPI / 2 For i = 1 To iSides Print #1, 0 Print #1, "LINE" Print #1, 8 Print #1, "Polygon" Print #1, 10 Print #1, dblX Print #1, 20 Print #1, dblY dblNX = dblLen * Cos(dblA) + dblX dblNY = dblLen * Sin(dblA) + dblY Print #1, 11 Print #1, dblNX Print #1, 21 Print #1, dblNY dblX = dblNX dblY = dblNY dblA = dblA + dblA1 Next i Print #1, 0 Print #1, "ENDSEC" Print #1, 0 Print #1, "EOF" Close #1 End Sub
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 BASIC program
157
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.
Following the sentinel are pairs (group, value) as in an ASCII DXF file but represented in binary form. The group code is a 2-byte binary value (1-byte in DXF files prior to AutoCAD Release 14), and the value that follows is one of the following:
s s s
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
158
Appendix A
The type of data 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 singlebyte, 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 1071 999999
Escape group code True group code Value for the 1071 group code
SAVEAS writes binary DXF files with the same file type (.dxf) as for ASCII DXF files. The OPEN and INSERT commands automatically recognizes a binary file
by means of its sentinel string. You need not identify it as a binary file. If the OPEN and INSERT commands encounter an error in a binary DXF file, AutoCAD reports the byte address within the file where the error was detected.
Slide Files
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 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 drawing area of the display device from which the slide was created with point (0,0) located at the lower-left corner of the drawing area. For
Slide Files
159
AutoCAD Release 9 and later, the slide file header consists of the following fields: Slide file header
Field ID string Type indicator Level indicator High X dot High Y dot Aspect ratio Bytes 17 1 1 2 2 4 Description AutoCAD Slide CR LF ^Z NUL Currently set to 56 (decimal) Currently set to 2 Width of the graphics area: 1, in pixels Height of the graphics area: 1, in pixels Drawing 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 Either 0 or 2 (value is unimportant) 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)
2 2
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 in the previous table. Slide file data records
Record type (hex) Bytes 00-7F 8 Meaning Vector Description 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 Reserved for future use
80-FA
Undefined
160
Appendix A
FC FD
2 6
FE
FF
New color
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 drawing area, a green vertical line near the lower-left corner, and a small red rectangle at the lower-left corner.
Slide Files
161
41 75 44 20 65 0D 56 02 3C 02 24 01 0B 80 02 00 34 12 07 FF 3C 02 3 FF 0F 00
74 6F 43 41 53 6C 69 64 0A 1A 00
ID string (AutoCAD Slide CR LF ^Z NUL) Type indicator (56) Level indicator (2) High X dot (572) High Y dot (292) Aspect ratio (14,647,307 / 10,000,000 = 1.46) Hardware fill (2) Test number (1234 hex) New color (7 = white) Vector from 572,292 to 0,0. 572,292 becomes last point New color (3 = green) Vector from 15,50 to 15,19. \x1115,50 becomes last point New color (1 = red) Offset vector from 15+18,50-25 (33,25) to 15+18, 50-50 (33,0). 33,25 becomes last point Common-endpoint vector from 33,25 to 33-33,25+0 (0,25). 0,25 becomes last point Common-endpoint vector from (0,25) to 0+0,25-25 (0,0). 0,0 becomes last point Common-endpoint vector from (0,0) to 0+33,0+0 (33,0).33,0 becomes last point End of file
DF 00
24 01 00 00 00 00 32 00 0F 00 13 00
01 FF 12 FB E7 12 CE DF FE 00 00 FE E7 21 FE 00 00 FC
162
Appendix A
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.
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.
163
164
Appendix A
B
In this chapter
s Database Objects s Persistent Inter-Object
This appendix discusses the advanced concepts related to DXF group codes.
Reference Handles
s Subclass Markers s Extension Dictionary and
Persistent Reactors
s Extended Data s Object Coordinate Systems
(OCS)
s Arbitrary Axis Algorithm
165
Database Objects
AutoCAD drawings consist largely of structured containers for database objects. Database objects each have the following:
s
s s s
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.
These handle types are manifested as entity names in AutoLISP , as ads_name values in ObjectARX and as like-named classes derived from ObjectARX. 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.
166
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 inserted into another drawing, references between the involved objects are translated. Although 1005 xdata items are always returned as handles in AutoLISP and ObjectARX, all of the reference handle group code ranges are represented as entity names in AutoLISP and as ads_name structures in ObjectARX.
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.
167
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.
Subclass Markers
When filing a stream of group data, a single object may be composed of several filer members, one for each level of inheritance where filing is done. Since derived classes and levels of inheritance can evolve separately, the data of each class filer member must be segregated from other members. This is achieved using subclass markers. All class filer members are expected to precede their class-specific portion of instance data with a subclass markera 100 group code followed by a string with the actual name of the class. This does not affect the state needed to define the objects 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 that has data from different derived classes would be represented as follows:
168
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
Subclass Markers
169
Extended Data
Extended data (xdata) is created by AutoLISP or ObjectARX applications. If an entity contains extended data, it follows the entitys 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
170
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 applications 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 arent currently used in the drawing. Each APPID name can have no more than one data group attached to each entity. Within an applications group, the sequence of extended data groups and their meaning is defined by the application. The extended data group codes are listed in the following table. Extended data group codes and descriptions
Entity name String Group code 1000 Description Strings in extended data can be up to 255 bytes long (with the 256th byte reserved for the null character)
Extended Data
171
Control string
1002
1003 1004
Database handle
1005
3 reals
Real Distance
172
Integer Long
1070 1071
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 on page 175).
For some entities, the OCS is equivalent to the WCS and all points (DXF groups 1037) are expressed in world coordinates. See the following table. Coordinate systems associated with an entity type
Entities Notes
3D entities such as line, point, These entities do not lie in a particular plane. All points 3dface, 3D polyline, 3D vertex, are expressed in world coordinates. Of these entities, 3D mesh, 3D mesh vertex only lines and points can be extruded. Their extrusion direction can differ from the world Z axis
173
Viewport
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:
s s
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 SAVEAS, you probably wont 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.
174
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.
175
176
Index
*Model_Space block definition, 57 *Paper_Space block definition, 57 2D entities, coordinate systems associated with, 174 3D entities, coordinate systems associated with, 173 3dface group codes, 62 3dsolid group codes , 63
A
acad_proxy_entity group codes, 63 ACAD_PROXY_OBJECT group codes, 117 ACADMAINTVER DXF system variable, 16 ACADVER DXF system variable, 16 ACDBDICTIONARYWDFLT group codes, 118 ACDBPLACEHOLDER group codes , 119 aligned dimension group codes , 71 ANGBASE DXF system variable , 16 ANGDIR DXF system variable, 16 angular dimension group codes , 74 anonymous blocks , 56 APPID group codes , 38 xdata groupings and, 171 application-defined object types, 116 arbitrary axis algorithm , 175 arbitrary handles , 166 arc edge data for hatch entities, 81 arc group codes , 64 ASCII control characters in DXF files, 147 ASCII DXF files about, 145 vs. binary DXF files, 158 BLOCKS section (example), 152 CLASSES section (example), 148
control character handling, 147 ENTITIES section (example), 153 HEADER section (example), 148 maximum file string length , 147 OBJECTS section (example), 153 reading (example), 154 sections of, 146 structure of, 146 TABLES section (example), 149 writing (example), 156 attdef group codes, 65 ATTMODE DXF system variable, 16 attrib group codes , 66 AUNITS DXF system variable, 16 AUPREC DXF system variable, 16 AutoLISP arbitrary handles and, 167 entnext function output for ole2frame entity (example), 96 group code 1005 xdata items and, 168 handent function, 168 reference handles and, 166 , 167
B
binary DXF files, 145 , 158 block definitions about, 56 Model_Space and Paper_Space, 57 UCS/WCS and, 57 block group codes , 56 block reference (insert) group codes , 85 block table handles , 56 BLOCK_RECORD group codes , 39 BLOCKS section
177
about, 55 , 147 example of, 152 group codes in, 56 and writing a DXF file, 156 blocks, anonymous, 56 body group codes , 68 boundary path data for hatch entities, 80
C
C++ class names, default class values , 33 CECOLOR DXF system variable, 16 CELTSCALE DXF system variable , 16 CELTYPE DXF system variable, 16 CELWEIGHT DXF system variable, 16 CEPSNTYPE DXF system variable, 16 CHAMFERA DXF system variable, 16 CHAMFERB DXF system variable , 16 CHAMFERC DXF system variable , 17 CHAMFERD DXF system variable, 17 circle group codes, 69 CLASSES section about, 31 , 146 default class values by DXF record name and C++ class name, 33 group codes in, 32 CLAYER DXF system variable, 17 CMLJUST DXF system variable, 17 CMLSCALE DXF system variable, 17 CMLSTYLE DXF system variable, 17 common entity group codes, 60 control character handling, 147 conventions used in this reference, 6 coordinate systems associated with entity types, 173 CPSNID DXF system variable, 16
D
database objects, 166 default class values by DXF record name and C++ class name, 33 deleted items in symbol tables, 36 diameter dimension group codes , 73 dictionaries, named object , 116 DICTIONARY group codes , 120 DICTIONARYVAR group codes , 121, 122 DIMADEC DXF system variable, 17 DIMALT DXF system variable, 17 DIMALTD DXF system variable, 17 DIMALTF DXF system variable, 17 DIMALTRND DXF system variable, 17 DIMALTTD DXF system variable, 17 DIMALTTZ DXF system variable, 17 DIMALTU DXF system variable, 17 DIMALTZ DXF system variable, 17 DIMAPOST DXF system variable, 17
DIMASO DXF system variable, 18 DIMASZ DXF system variable, 18 DIMATFIT DXF system variable , 18 DIMAUNIT DXF system variable, 18 DIMAZIN DXF system variable, 18 DIMBLK DXF system variable, 18 DIMBLK1 DXF system variable, 18 DIMBLK2 DXF system variable, 18 DIMCEN DXF system variable , 18 DIMCLRD DXF system variable, 18 DIMCLRE DXF system variable, 18 DIMCLRT DXF system variable , 18 DIMDEC DXF system variable, 18 DIMDLE DXF system variable, 18 DIMDLI DXF system variable, 18 DIMDSEP DXF system variable, 19 dimension entities, coordinate systems associated with, 174 dimension group codes , 69 aligned, 71 angular, 74 common, 69 diameter , 73 linear , 72 ordinate, 75 radial, 73 rotated, 72 dimension style overrides , 76 DIMEXE DXF system variable, 19 DIMEXO DXF system variable, 19 DIMFRAC DXF system variable, 19 DIMGAP DXF system variable , 19 DIMJUST DXF system variable , 19 DIMLDRBLK DXF system variable, 19 DIMLFAC DXF system variable, 19 DIMLIM DXF system variable, 19 DIMLUNIT DXF system variable, 19 DIMLWD DXF system variable , 19 DIMLWE DXF system variable, 19 DIMPOST DXF system variable, 19 DIMRND DXF system variable, 19 DIMSAH DXF system variable, 19 DIMSCALE DXF system variable, 20 DIMSD1 DXF system variable , 20 DIMSD2 DXF system variable , 20 DIMSE1 DXF system variable, 20 DIMSE2 DXF system variable, 20 DIMSHO DXF system variable , 20 DIMSOXD DXF system variable , 20 DIMSTYLE table handle code, 36 DIMSTYLE DXF system variable, 20 DIMSTYLE group codes , 40 DIMSTYLE table handle code , 36 DIMTAD DXF system variable, 20 DIMTDEC DXF system variable, 20 DIMTFAC DXF system variable, 20
178
Index
DIMTIH DXF system variable, 20 DIMTIX DXF system variable, 20 DIMTM DXF system variable, 20 DIMTMOVE DXF system variable, 20 DIMTOFL DXF system variable, 20 DIMTOH DXF system variable, 20 DIMTOL DXF system variable, 20 DIMTOLJ DXF system variable, 20 DIMTP DXF system variable, 21 DIMTSZ DXF system variable, 21 DIMTVP DXF system variable, 21 DIMTXSTY DXF system variable, 21 DIMTXT DXF system variable, 21 DIMTZIN DXF system variable, 21 DIMUPT DXF system variable, 21 DIMZIN DXF system variable , 21 DISPSILH DXF system variable, 21 drawing interchange file formats ASCII DXF , 145 , 146 binary DXF , 145, 158 Slide (SLD), 159 Slide Library (SLB), 163 DWGCODEPAGE DXF system variable, 21 DXF conventions group code ranges, 7 group codes in numerical order, 9 file parsers, subclass markers and, 168 files. See ASCII DXF files; binary DXF files format about, 5 interface programs, writing (example), 154 record names, default class values , 33 system variables , 16 DXFIN considerations for writing DXF files , 157
EXTMIN DXF system variable, 21 EXTNAMES DXF system variable , 22 extrusion direction, OCS properties for, 173
F
FASTZ revised VPORT header variable, 28 filing a stream of group data, subclass markers and, 168 FILLETRAD DXF system variable, 22 FILLMODE DXF system variable, 22 FINGERPRINTGUID DXF system variable , 22
G
getvar AutoLISP function, 148 graphical object group codes. See names of specific objects GRIDMODE revised VPORT header variable, 28 GRIDUNIT revised VPORT header variable, 28 group codes about, 146 arbitrary handle range, 166 ASCII DXF files and, 147 binary DXF files and, 158 for entities (graphical objects), 60 examples of, 148 formatting conventions for, 6 in numerical order, 9 objects/entities and, 6 ranges of, 7 reference handle ranges , 166 for xdata , 171 group data, subclass markers and, 168 GROUP group codes , 124
E
ECS. See object coordinate system ELEVATION DXF system variable, 21 elevation value for entity positioning, 173 ellipse edge data for hatch entities, 82 ellipse group codes , 76 elliptical arc definition , 77 endblk group codes, 58 ENDCAPS DXF system variable, 21 entities block, 56 coordinate systems associated with, 173 endblk, 56 entity group codes vs. object codes, 6 group codes listed in numerical order, 9 ENTITIES section about, 59 , 147 and writing a DXF file, 156 extension dictionary, 170 EXTMAX DXF system variable, 21
H
handent functions (AutoLISP), 168 handles about, 166 arbitrary, 166 of dictionary objects , 170 reference, 166 HANDSEED DXF system variable, 22 hard references vs. soft references , 167 hard-owner handles, 166 hard-pointer handles , 166 hatch group codes , 78 hatch pattern data, 83 HEADER section about, 15 , 146 example of, 148 group codes for revised VPORT variables , 27 group codes for saved DXF system variables, 16
Index
179
time/date variables, handling of, 28 and writing a DXF file, 156 HYPERLINKBASE DXF system variable, 22
N
named object dictionary, 116 nongraphical object group codes. See names of specific objects normal vector, arbitrary axis algorithm and, 175 numerical order group codes, 9
I
IDBUFFER group codes , 125 image group codes , 83 IMAGEDEF group codes, 125 IMAGEDEF_REACTOR group codes , 126 inheritance levels for filer members, subclass markers and, 168 INSBASE DXF system variable , 22 INSERT command ASCII control character handling and, 147 binary DXF files and, 159 insert group codes , 85 INSUNITS DXF system variable, 22
O
object coordinate system (OCS), 173 arbitrary axis algorithm and, 175 OBJECT_PTR group codes , 132 ObjectARX group code 1005 xdata items and, 168 reference handles and, 166 , 167 ObjectARX, reference handles and, 166 objects object group codes vs. entity codes , 6 ownership of, 116 OBJECTS section about, 115, 147 common group codes , 116 ole2frame entities, AutoLISP entnext function output (example), 96 ole2frame group codes , 94 DXF output (example), 95 oleframe group codes, 93 OPEN command ASCII control character handling and, 147 binary DXF files and, 159 ordinate dimension group codes, 75 ORTHOMODE DXF system variable, 23 ownership pointers to extension dictionaries , 166 ownership references vs. pointer references , 167
J
JOINSTYLE DXF system variable , 22
L
LAYER group codes , 44 LAYER_FILTER group codes , 128 LAYER_INDEX group codes , 127 LAYOUT group codes, 128 leader group codes , 86 LIMCHECK DXF system variable, 22 LIMMAX DXF system variable, 22 LIMMIN DXF system variable, 22 line edge data for hatch entities, 81 line group codes , 88 linear dimension group codes , 72 LTSCALE DXF system variable , 22 LTYPE group codes , 45 LUNITS DXF system variable, 22 LUPREC DXF system variable, 22 LWDISPLAY DXF system variable, 23 lwpolyline group codes , 88
P
Paper_Space block definition, 57 pattern data for hatch entities, 83 PDMODE DXF system variable, 23 PDSIZE DXF system variable, 23 PELEVATION DXF system variable, 23 persistent inter-object reference handles , 166 persistent reactor tables , 166 , 170 PEXTMAX DXF system variable, 23 PEXTMIN DXF system variable, 23 PFACE command considerations , 98 PINSBASE DXF system variable, 23 PLIMCHECK DXF system variable, 23 PLIMMAX DXF system variable, 23 PLIMMIN DXF system variable, 23 PLINEGEN DXF system variable, 23 PLINEWID DXF system variable, 23, 24 PLOTSETTINGS group codes , 133 point group codes , 96
M
MAXACTVP DXF system variable, 23 MEASUREMENT DXF system variable , 23 MENU DXF system variable, 23 MIRRTEXT DXF system variable, 23 mline group codes , 89 MLINESTYLE group codes , 131 Model_Space block definition, 57 MSLIDE/VSLIDE commands , 159 mtext group codes , 92
180
Index
pointer references vs. ownership references , 167 polyface meshes in DXF, 98 polyline boundary data for hatch entities, 81 polyline group codes , 97 polyface meshes and, 98 PROXYGRAPHICS DXF system variable, 23 PSLTSCALE DXF system variable, 23 PSVPSCALE DXF system variable, 24 PUCSBASE DXF system variable, 24 PUCSNAME DXF system variable, 24 PUCSORG DXF system variable , 24 PUCSORGBACK DXF system variable, 24 PUCSORGBOTTOM DXF system variable, 24 PUCSORGFRONT DXF system variable , 24 PUCSORGLEFT DXF system variable, 24 PUCSORGRIGHT DXF system variable, 24 PUCSORGTOP DXF system variable , 24 PUCSORTHOREF DXF system variable, 24 PUCSORTHOVIEW DXF system variable , 24 PUCSXDIR DXF system variable, 24 PUCSYDIR DXF system variable, 24
Q
QTEXTMODE DXF system variable, 25
R
radial dimension group codes, 73 ranges of group codes , 7 RASTERVARIABLES group codes , 135 ray group codes, 99 reading a DXF file (example), 154 reference handles hard vs. soft, 167 pointer vs. ownership, 167 types of, 166 REGENMODE DXF system variable, 25 region group codes, 99 rotated dimension group codes , 72
S
SAVE command Binary option, 158 Select Objects option, 147 SAVEAS command ASCII control character handling and, 147 binary DXF files and, 159 Binary option, 158 Select Objects option, 147 sequend group codes , 100 SHADEDGE DXF system variable, 25 SHADEDIF DXF system variable, 25 shape group codes , 100 SKETCHINC DXF system variable , 25
SKPOLY DXF system variable , 25 slide (SLD) files about, 159 data record types, 160 header format, 159 hex dump of (example), 161 old-format header , 162 vectors and, 160 slide library (SLB) file format, 163 SNAPANG revised VPORT header variable, 28 SNAPBASE revised VPORT header variable, 28 SNAPISOPAIR revised VPORT header variable, 28 SNAPMODE revised VPORT header variable, 28 SNAPSTYLE revised VPORT header variable, 28 SNAPUNIT revised VPORT header variable, 28 soft references vs. hard references , 167 soft-owner handles, 166 soft-pointer handles , 166, 167 solid group codes , 101 SORTENTSTABLE group codes , 138 SPATIAL_FILTER group codes , 137 SPATIAL_INDEX group codes, 136 SPLFRAME DXF system variable , 25 spline edge data for hatch entities, 82 spline group codes , 102 SPLINESEGS DXF system variable, 25 SPLINETYPE DXF system variable , 25 STYLE group codes , 46 subclass markers , 168 SURFTAB1 DXF system variable, 25 SURFTAB2 DXF system variable, 25 SURFTYPE DXF system variable, 25 SURFU DXF system variable , 25 SURFV DXF system variable , 25 symbol table entries common group codes , 37 structure of, 36 symbol tables common group codes , 36 deleted items and, 36 DIMSTYLE handle, 36 handles and, 166 identifying, 36 structure of, 36 system variables, saved in DXF files , 16
T
TABLES section about, 35 , 146 example of, 149 symbol table common group codes, 36 symbol table structure, 36 and writing a DXF file, 156 tagged data, 5 TDCREATE DXF system variable, 25 TDINDWG DXF system variable, 25
Index
181
TDUCREATE DXF system variable, 25 TDUPDATE DXF system variable, 25 TDUSRTIMER DXF system variable, 25 TDUUPDATE DXF system variable , 26 text group codes , 103 TEXTSIZE DXF system variable, 26 TEXTSTYLE DXF system variable , 26 THICKNESS DXF system variable, 26 THUMBNAIL section about, 147 THUMBNAILIMAGE group codes , 144 THUMBNAILIMAGE section about, 143 TILEMODE DXF system variable, 26 time/date variables, handling of, 28 tolerance group codes, 105 TRACE DXF system variable, 26 trace group codes , 106 TREEDEPTH DXF system variable, 26
vertex group codes , 107 VIEW group codes, 49 VIEWCTR revised VPORT header variable, 28 VIEWDIR revised VPORT header variable, 28 viewport entities coordinate systems associated with, 174 viewport group codes , 109 VIEWSIZE revised VPORT header variable, 28 VISRETAIN DXF system variable, 27 Visual Basic programs (examples) for reading a DXF file, 154 for writing a DXF file, 157 VPORT group codes , 51 VPORT header variables, revised, 27 VSLIDE/MSLIDE commands , 159
W
world coordinate system (WCS), 173 WORLDVIEW DXF system variable, 27 writing a DXF file (example), 156
U
UCS group codes, 47 UCSBASE DXF system variable , 26 UCSNAME DXF system variable, 26 UCSORG DXF system variable, 26 UCSORGBACK DXF system variable, 26 UCSORGBOTTOM DXF system variable, 26 UCSORGFRONT DXF system variable, 26 UCSORGLEFT DXF system variable, 26 UCSORGRIGHT DXF system variable, 26 UCSORGTOP DXF system variable, 26 UCSORTHOREF DXF system variable, 26 UCSORTHOVIEW DXF system variable, 27 UCSXDIR DXF system variable, 27 UCSYDIR DXF system variable, 27 UNITMODE DXF system variable, 27 user coordinate system (UCS), 174 USERI1-5 DXF system variable, 27 USERR1-5 DXF system variable, 27 USRTIMER DXF system variable, 27
X
X and Y axes orientation calculations , 173, 174, 175 X axis, arbitrary axis algorithm and, 175 xdata and dimension entities, 76 sample entity containing (DXF format), 170 xdata group codes , 171 binary DXF group codes , 158 XEDIT DXF system variable, 27 xline group codes , 113 XRECORD group codes , 140 XY coordinates, working with, 174
Y
Y axis, arbitrary axis algorithm and, 175
Z V
VBA_PROJECT group codes , 139 vectors, in slide files, 160 VERSIONGUID DXF system variable, 27 Z axis arbitrary axis algorithm and, 175 OCS properties for , 173
182
Index