DXF Group Codes
HEADER Section

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

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

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

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

  0
SECTION
  2
HEADER


Beginning of HEADER section



  9
$<variable>
<group code>
<value>


Repeats for each header variable



  0
ENDSEC


End of HEADER section


The following table lists the variables that are saved in a DXF file.

DXF system variables
Variable Group code Description

$ACADMAINTVER

70

Maintenance version number (should be ignored)

$ACADVER

1

The AutoCAD drawing database version number:
AC1006 = R10, AC1009 = R11 and R12, AC1012 = R13, AC1014 = R14

$ANGBASE

50

Angle 0 direction

$ANGDIR

70

1 = clockwise angles, 0 = counterclockwise

$ATTDIA

70

Attribute entry dialogs: 1 = on, 0 = off

$ATTMODE

70

Attribute visibility: 0 = none, 1 = normal, 2 = all

$ATTREQ

70

Attribute prompting during INSERT: 1 = on, 0 = off

$AUNITS

70

Units format for angles

$AUPREC

70

Units precision for angles

$BLIPMODE

70

Blip mode on if nonzero

$CECOLOR

62

Current entity color number: 0 = BYBLOCK, 256 = BYLAYER

$CELTSCALE

40

Current entity linetype scale

$CELTYPE

6

Entity linetype name, or BYBLOCK or BYLAYER

$CHAMFERA

40

First chamfer distance

$CHAMFERB

40

Second chamfer distance

$CHAMFERC

40

Chamfer length

$CHAMFERD

40

Chamfer angle

$CLAYER

8

Current layer name

$CMLJUST

70

Current multiline justification: 0=Top,1=Middle, 2=Bottom

$CMLSCALE

40

Current multiline scale

$CMLSTYLE

2

Current multiline style name

$COORDS

70

Coordinate display:
0 = static, 1 = continuous update, 2 = "d<a" format

$DELOBJ

70

Controls object deletion: 0=deleted, 1=retained

$DIMALT

70

Alternate unit dimensioning performed if nonzero

$DIMALTD

70

Alternate unit decimal places

$DIMALTF

40

Alternate unit scale factor

$DIMALTTD

70

Number of decimal places for tolerance values of an alternate units dimension

$DIMALTTZ

70

Controls suppression of zeros for alternate tolerance values:
0 = Suppresses zero feet and precisely zero inches
1 = Includes zero feet and precisely zero inches
2 = Includes zero feet and suppresses zero inches
3 = Includes zero inches and suppresses zero feet

$DIMALTU

70

Units format for alternate units of all dimension style family members except angular:
1 = Scientific; 2 = Decimal; 3 = Engineering;
4 = Architectural (stacked); 5 = Fractional (stacked);
6 = Architectural; 7 = Fractional

$DIMALTZ

70

Controls suppression of zeros for alternate unit dimension values:
0 = Suppresses zero feet and precisely zero inches
1 = Includes zero feet and precisely zero inches
2 = Includes zero feet and suppresses zero inches
3 = Includes zero inches and suppresses zero feet

$DIMAPOST

1

Alternate dimensioning suffix

$DIMASO

70

1 = create associative dimensioning, 0 = draw individual entities

$DIMASZ

40

Dimensioning arrow size

$DIMAUNIT

70

Angle format for angular dimensions:
0=Decimal degrees, 1=Degrees/minutes/seconds, 2=Gradians, 3=Radians, 4=Surveyor's units

$DIMBLK

1

Arrow block name

$DIMBLK1

1

First arrow block name

$DIMBLK2

1

Second arrow block name

$DIMCEN

40

Size of center mark/lines

$DIMCLRD

70

Dimension line color: range is 0 = BYBLOCK, 256 = BYLAYER

$DIMCLRE

70

Dimension extension line color:  range is 0 = BYBLOCK,
256 = BYLAYER

$DIMCLRT

70

Dimension text color:  range is 0 = BYBLOCK, 256 = BYLAYER

$DIMDEC

70

Number of decimal places for the tolerance values of a primary units dimension

$DIMDLE

40

Dimension line extension

$DIMDLI

40

Dimension line increment

$DIMEXE

40

Extension line extension

$DIMEXO

40

Extension line offset

$DIMFIT

70

Placement of text and arrowheads; Possible values: 0 through 3 (see appendix A, "System Variables," in the Command Reference)

$DIMGAP

40

Dimension line gap

$DIMJUST

70

Horizontal dimension text position: 0=above dimension line and center-justified between extension lines, 1=above dimension line and next to first extension line, 2=above dimension line and next to second extension line, 3=above and center-justified to first extension line, 4=above and center-justified to second extension line

$DIMLFAC

40

Linear measurements scale factor

$DIMLIM

70

Dimension limits generated if nonzero

$DIMPOST

1

General dimensioning suffix

$DIMRND

40

Rounding value for dimension distances

$DIMSAH

70

Use separate arrow blocks if nonzero

$DIMSCALE

40

Overall dimensioning scale factor

$DIMSD1

70

Suppression of first extension line:
0=not suppressed, 1=suppressed

$DIMSD2

70

Suppression of second extension line:


0=not suppressed, 1=suppressed

$DIMSE1

70

First extension line suppressed if nonzero

$DIMSE2

70

Second extension line suppressed if nonzero

$DIMSHO

70

1 = Recompute dimensions while dragging,
0 = drag original image

$DIMSOXD

70

Suppress outside-extensions dimension lines if nonzero

$DIMSTYLE

2

Dimension style name

$DIMTAD

70

Text above dimension line if nonzero

$DIMTDEC

70

Number of decimal places to display the tolerance values

$DIMTFAC

40

Dimension tolerance display scale factor

$DIMTIH

70

Text inside horizontal if nonzero

$DIMTIX

70

Force text inside extensions if nonzero

$DIMTM

40

Minus tolerance

$DIMTOFL

70

If text outside extensions, force line extensions between extensions if nonzero

$DIMTOH

70

Text outside horizontal if nonzero

$DIMTOL

70

Dimension tolerances generated if nonzero

$DIMTOLJ

70

Vertical justification for tolerance values:
0=Top, 1=Middle, 2=Bottom

$DIMTP

40

Plus tolerance

$DIMTSZ

40

Dimensioning tick size:  0 = no ticks

$DIMTVP

40

Text vertical position

$DIMTXSTY

7

Dimension text style

$DIMTXT

40

Dimensioning text height

$DIMTZIN

70

Controls suppression of zeros for tolerance values:
0 = Suppresses zero feet and precisely zero inches
1 = Includes zero feet and precisely zero inches
2 = Includes zero feet and suppresses zero inches
3 = Includes zero inches and suppresses zero feet

$DIMUNIT

70

Units format for all dimension style family members except angular:  
1 = Scientific; 2 = Decimal; 3 = Engineering;
4 = Architectural (stacked); 5 = Fractional (stacked);
6 = Architectural; 7 = Fractional

$DIMUPT

70

Cursor functionality for user positioned text:  0=controls only the dimension line location, 1=controls the text position as well as the dimension line location

$DIMZIN

70

Controls suppression of zeros for primary unit values:
0 = Suppresses zero feet and precisely zero inches
1 = Includes zero feet and precisely zero inches
2 = Includes zero feet and suppresses zero inches
3 = Includes zero inches and suppresses zero feet

$DISPSILH

70

Controls the display of silhouette curves of body objects in wire-frame mode: 0=Off, 1=On

$DRAGMODE

70

0 = off, 1 = on, 2 = auto

$DWGCODEPAGE

3

Drawing code page; Set to the system code page when a new drawing is created, but not otherwise maintained by AutoCAD

$ELEVATION

40

Current elevation set by ELEV command

$EXTMAX

10, 20, 30

X, Y, and Z drawing extents upper-right corner (in WCS)


$EXTMIN

10, 20, 30

X, Y, and Z drawing extents lower-left corner (in WCS)


$FILLETRAD

40

Fillet radius

$FILLMODE

70

Fill mode on if nonzero

$HANDLING

70

Next available handle

$HANDSEED

5

Next available handle

$INSBASE

10, 20, 30

Insertion base set by BASE command (in WCS)

$LIMCHECK

70

Nonzero if limits checking is on

$LIMMAX

10, 20

XY drawing limits upper-right corner (in WCS)


$LIMMIN

10, 20

XY drawing limits lower-left corner (in WCS)


$LTSCALE

40

Global linetype scale

$LUNITS

70

Units format for coordinates and distances

$LUPREC

70

Units precision for coordinates and distances

$MAXACTVP

70

Sets maximum number of viewports to be regenerated

$MEASUREMENT

70

Sets drawing units. 0=English; 1=Metric

$MENU

1

Name of menu file

$MIRRTEXT

70

Mirror text if nonzero

$ORTHOMODE

70

Ortho mode on if nonzero

$OSMODE

70

Running object snap modes

$PDMODE

70

Point display mode

$PDSIZE

40

Point display size

$PELEVATION

40

Current paper space elevation

$PEXTMAX

10, 20, 30

Maximum X, Y, and Z extents for paper space

$PEXTMIN

10, 20, 30

Minimum X, Y, and Z extents for paper space

$PICKSTYLE

70

Controls group selection and associative hatch selection:
0=No group selection or associative hatch selection,
1=Group selection,
2 =Associative hatch selection,
3 =Group selection and associative hatch selection

$PINSBASE

10, 20, 30

Paper space insertion base point

$PLIMCHECK

70

Limits checking in paper space when nonzero

$PLIMMAX

10, 20

Maximum X and Y limits in paper space

$PLIMMIN

10, 20

Minimum X and Y limits in paper space

$PLINEGEN

70

Governs the generation of linetype patterns around the vertices of a 2D polyline:
1 = linetype is generated in a continuous pattern around vertices of the polyline,
0 = each segment of the polyline starts and ends with a dash

$PLINEWID

40

Default polyline width

$PROXYGRAPHICS

70

Controls the saving of proxy object images

$PSLTSCALE

70

Controls paper space linetype scaling:
1 = no special linetype scaling
0 = viewport scaling governs linetype scaling

$PUCSNAME

2

Current paper space UCS name

$PUCSORG

10, 20, 30

Current paper space UCS origin

$PUCSXDIR

10, 20, 30

Current paper space UCS X axis

$PUCSYDIR

10, 20, 30

Current paper space UCS Y axis

$QTEXTMODE

70

Quick text mode on if nonzero

$REGENMODE

70

REGENAUTO mode on if nonzero

$SHADEDGE

70

0 = faces shaded, edges not highlighted
1 = faces shaded, edges highlighted in black
2 = faces not filled, edges in entity color
3 = faces in entity color, edges in black

$SHADEDIF

70

Percent ambient/diffuse light, range 1-100, default 70

$SKETCHINC

40

Sketch record increment

$SKPOLY

70

0 = sketch lines, 1 = sketch polylines

$SPLFRAME

70

Spline control polygon display: 1 = on, 0 = of

$SPLINESEGS

70

Number of line segments per spline patch

$SPLINETYPE

70

Spline curve type for PEDIT Spline

$SURFTAB1

70

Number of mesh tabulations in first direction

$SURFTAB2

70

Number of mesh tabulations in second direction

$SURFTYPE

70

Surface type for PEDIT Smooth

$SURFU

70

Surface density (for PEDIT Smooth) in M direction

$SURFV

70

Surface density (for PEDIT Smooth) in N direction

$TDCREATE

40

Date/time of drawing creation

$TDINDWG

40

Cumulative editing time for this drawing

$TDUPDATE

40

Date/time of last drawing update

$TDUSRTIMER

40

User elapsed timer

$TEXTSIZE

40

Default text height

$TEXTSTYLE

7

Current text style name

$THICKNESS

40

Current thickness set by ELEV command

$TILEMODE

70

1 for previous release compatibility mode, 0 otherwise

$TRACEWID

40

Default trace width

$TREEDEPTH

70

Specifies the maximum depth of the spatial index.

$UCSNAME

2

Name of current UCS

$UCSORG

10, 20, 30

Origin of current UCS (in WCS)

$UCSXDIR

10, 20, 30

Direction of current UCS's X axis (in WCS)

$UCSYDIR

10, 20, 30

Direction of current UCS's Y axis (in WCS)

$UNITMODE

70

Low bit set = display fractions, feet-and-inches, and surveyor's angles in input format

$USERI1 - 5

70

Five integer variables intended for use by third-party developers

$USERR1 - 5

40

Five real variables intended for use by third-party developers

$USRTIMER

70

0 = timer off, 1 = timer on

$VISRETAIN

70

0 = don't retain xref-dependent visibility settings, 1 = retain
xref-dependent visibility settings

$WORLDVIEW

70

1 = set UCS to WCS during DVIEW/VPOINT, 0 = don't change UCS

The following header variables existed prior to AutoCAD Release 11 but now have independent settings for each active viewport. DXFIN honors these variables when read from DXF files, but if a VPORT symbol table with *ACTIVE entries is present (as is true for any DXF file produced by Release 11 or higher), the values in the VPORT table entries override the values of these header variables.

Revised VPORT header variables
Variable Group code Description

$FASTZOOM

70

Fast zoom enabled if nonzero

$GRIDMODE

70

Grid mode on if nonzero

$GRIDUNIT

10, 20

Grid X and Y spacing

$SNAPANG

50

Snap grid rotation angle

$SNAPBASE

10, 20

Snap/grid base point (in UCS)

$SNAPISOPAIR

70

Isometric plane: 0 = left, 1 = top, 2 = right

$SNAPMODE

70

Snap mode on if nonzero

$SNAPSTYLE

70

Snap style: 0 = standard, 1 = isometric

$SNAPUNIT

10, 20

Snap grid X and Y spacing

$VIEWCTR

10, 20

XY center of current view on screen


$VIEWDIR

10, 20, 30

Viewing direction (direction from target in WCS)

$VIEWSIZE

40

Height of view

The date/time variables ($TDCREATE and $TDUPDATE) are output as real numbers in the following format:

<Julian date>.<Fraction>

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

<number of days>.<Fraction>

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