DXF-CSV v1.0 Reference
The normative core of the format: what every column means, how coordinates and blocks are encoded, and the design principle behind what DXF-CSV keeps and strips. For entity-by-entity column usage, see Entities. For the raw source, see spec.md.
Design principle
DXF-CSV applies a consistent filter to all DXF input regardless of source version.
Keep -- drafting semantics: geometry, layer, linetype, color, block structure, text content, dimension definition points, entity type.
Strip -- AutoCAD bookkeeping: handles (group 5), owner chains (330/360), group 100 subclass markers, CLASSES section, OBJECTS section, extension dictionaries, reactors, XDATA.
Rationale: Group 100 subclass markers are redundant with the
type column. Handles and owner chains serve AutoCAD's internal object
graph for reactor/notification dispatch -- they have no drafting meaning. The CLASSES
and OBJECTS sections register custom object types and non-graphical persistent objects
(plot settings, material references, etc.) that are not part of drawing geometry.
Post-R12 entities (LWPOLYLINE, SPLINE, MTEXT, etc.) are included where present, treated as if they were added to R12's orthogonal data model -- each entity's properties are independent, with no side-effect dependencies on other objects. This means no observers or reactors are needed to interpret the data.
Uniform export environment
CSVOUT runs AutoCAD with object enablers deliberately disabled. Object enablers
are .dbx modules that load custom object types into the drawing database
-- Civil 3D, Architecture, MEP, and other vertical products each ship their own. When
enablers are active, custom objects may serialize geometry in undocumented,
enabler-dependent formats or refuse to serialize at all. Disabling enablers produces a
uniform environment across all drawing types. Every drawing -- plain
AutoCAD, Civil 3D, Architecture -- exports through the same code path. Entities whose
geometry requires an enabler appear as zombie entities: the type name
and non-geometric properties (layer, color, linetype, style, paper space) are
preserved, but all geometry columns are absent.
Zombies are placeholders, not errors. The entity exists in the drawing with its
correct layer and properties. On round-trip import, nothing is lost -- the original
DWG (identified by source: and sha1:) holds the complete
object, and the importer restores it from there rather than from the CSV geometry.
The zombie list reflects which enablers were absent in the specific export session, not which objects are "third-party." Any entity type -- including plain AutoCAD entities -- can appear as a zombie when its handler is absent from the running AutoCAD session.
Single-entity-type column suppression: columns that would be
populated by only one entity type and carry no cross-entity semantic value are
suppressed -- the column is not added to the header even if the group code is present
in the source DXF. Example: char[281] (PDFUNDERLAY contrast) and
char[282] (PDFUNDERLAY fade) are suppressed when PDFUNDERLAY is the only
entity that would populate them. The entity is still exported -- only the
single-entity-type columns are dropped.
Implication for import: CSVIN operates in two modes depending on the target drawing:
- Modify mode -- the target is the original source drawing
identified by
source:andsha1:. CSVIN verifies the hash matches the open drawing and updates changed entities in place viaacdbEntMake/acdbEntMod. No DXF is generated or consumed. - Create mode -- the target is a known published template
(e.g.
sha1:781e2fb2654f,new.dxf). CSVIN merges the CSV into the template to produce a new DXF or DWG. The sha1 is a public constant -- any AI generating for this sha1 knows exactly what tables and handles are present. The resulting DXF from Drawing Sync's own writer contains only drafting content -- the OBJECTS section remains minimal, unlike AutoCAD-written DXF which appends thousands of lines of plot settings and render data.
In both modes the CSV carries geometry and drafting intent; bookkeeping is never round-tripped.
Derived counts are absent: counts that are fully redundant with their data columns are omitted from the CSV. CSVIN derives them by counting fields -- the count column would add no information. This applies to:
- SPLINE:
int[72](knot count derived fromreal[40]),int[73](control point count frompt[10]),int[74](fit point count frompt[11]) - MESH:
int[92](vertex count frompt[10]),int[95](crease count, always equal toint[94])
AI generators must not emit these columns. A consumer reading a DXF-CSV file should not expect them. This is a design rule, not a per-entity exception.
sha1 as drawing state contract: the sha1: clause is
not just documentation -- it is a contract between the CSV and the drawing state.
CSVIN verifies the hash before importing; if the open drawing doesn't match, import
is rejected. This mechanism supports a library of known starting points. An AI
generating content for sha1:396cb2c5a30e (empty AutoCAD 2018 template)
makes no assumptions about pre-existing blocks, layers, or styles -- it must define
everything it uses. An AI generating content for a domain-specific template sha1 can
reference blocks, layers, dimstyles, and text styles that already exist in that
drawing without redefining them, keeping the generated CSV lean and focused on design
intent rather than infrastructure. The sha1 is the key; the drawing is the state. One
exception to strict matching: an all-zero sha1 (000000000000) is treated
as equivalent to 396cb2c5a30e -- AI consumers generating from scratch
with no real source drawing commonly emit this placeholder rather than looking up the
real hash, and CSVIN accepts it with the same "no pre-existing references"
assumption.
Open library: anyone can define a template drawing, publish it, and document its sha1. No central registry or approval is required -- if the sha1 matches the open drawing, CSVIN imports cleanly and the expectations encoded in that template are guaranteed. Domain communities can maintain their own templates: architectural (standard layer names, door and window blocks, annotation styles), electrical (symbol libraries, IEC or NFPA layer conventions), civil (survey layers, coordinate systems), mechanical (ASME title blocks, GD&T styles). An AI targeting a known template sha1 can skip all table definitions and generate only entities -- the smallest possible CSV for the most complete result.
Currently published starting points:
| sha1 | Description |
|---|---|
396cb2c5a30e | Empty AutoCAD 2018 template (acad.dwt) -- no blocks, no named layers beyond 0, no styles beyond Standard. Use when generating from scratch for import into AutoCAD. |
000000000000 | AI-generated placeholder, equivalent to 396cb2c5a30e -- means "start from the latest AutoCAD template" with no references beyond the standard ones. AI consumers without a real source drawing commonly emit this all-zero sha1 rather than 396cb2c5a30e itself; CSVIN treats it the same way: no pre-existing blocks, layers, or styles may be assumed beyond 0 and Standard. |
781e2fb2654f | new.dxf -- Drawing Sync minimal DXF template, available at new.dxf or new.dxf.txt (text-accessible alias for browsers and AI fetch). AC1032 (DXF 2018), 308 lines. Contains the minimum valid structure: *Model_Space and *Paper_Space block records with handles, ByBlock/ByLayer/Continuous linetypes, layer 0, Standard style and dimstyle, ACAD appid. OBJECTS section is a single empty DICTIONARY -- no AutoCAD bookkeeping bloat. Use with -dsm to produce clean DXF output independent of AutoCAD. |
Column headers
Headers follow the pattern semanticname[code] where code
is the DXF group code number. All group codes are entity-scoped --
the same code number means different things on different entity types, exactly as in
the DXF specification. When in doubt, look up the code against the type
column value, not the column header.
The column set in any given file reflects only the group codes present in
that export. Columns are added to the header when a group code appears in
the data -- not when a section or table is included. A file with no arc entities will
have no angle[51] column. A file exported without DIMSTYLE will have none
of the dimvar columns. Always read the header row to determine the column set for that
file.
name[2] is required in every valid DXF-CSV file.
Every file contains SECTION, ENDSEC, LAYER, and LTYPE rows -- all of which use
name[2]. Omitting name[2] from the header leaves these rows
nameless and the file unimportable. When generating a DXF-CSV file, always include
name[2] in the header regardless of what other columns are present.
Column prefix reference
| Prefix | DXF resbuf type | Meaning |
|---|---|---|
type | RT_STR | Entity or record type (group code 0) |
text | RT_STR | String value |
name | RT_STR | Name string (block, layer, style, etc.) |
pt | RT_3DPOINT | 2D or 3D coordinate -- x,y or x,y,z |
real | RT_REAL | Floating-point scalar |
angle | RT_REAL | Angle in degrees |
int | RT_SHORT | 16-bit signed integer |
long | RT_LONG | 32-bit signed integer |
char | RTCHAR | Single-byte integer (0-255). DXF group codes 280-289 -- used for flags, boolean-like values, and small counts |
seq | RT_SHORT | Structural sequence flag (group code 66) |
paper | RT_SHORT | Paper-space flag (group code 67) |
color | RT_SHORT | ACI color index (group code 62) |
lwt | RT_SHORT | Lineweight (group code 370) |
ext | RT_3DPOINT | OCS extrusion normal vector (group code 210) |
elev | RT_REAL | Elevation (group code 38) |
thick | RT_REAL | Thickness (group code 39) |
style | RT_STR | Style name (group code 7) |
linetype | RT_STR | Linetype name (group code 6) |
variable | RT_STR | Header variable string (group code 9) |
Standard columns
All ~77 documented column headers, grouped below for scrolling -- expand any group to see its rows. Order matches spec.md; group titles describe what each covers rather than claiming a strict numeric range, since several codes (15, 93, 95) recur with different entity-scoped meanings.
Core identity, text, and points (type, text, name, layer, pt[10]-pt[15], pt[110]-pt[112])
| Header | Code | Meaning |
|---|---|---|
type | 0 | Entity type or record type. Primary key of every row. |
text[1] | 1 | String value -- TEXT content, ATTRIB value, DIMENSION override text. May contain MTEXT inline formatting codes (\A1;, {\H...}, etc.) when the source entity carried formatted text -- treat the same as MTEXT content |
name[2] | 2 | Name -- block name (INSERT/BLOCK), layer name (LAYER), section/table name, ATTRIB/ATTDEF tag |
text[3] | 3 | Entity-scoped string. On BLOCK rows: absent when equal to name[2]. On STYLE rows: font or shape filename (e.g. txt, romans.shx, ltypeshp.shx) when it differs from name[2] -- absent when it would duplicate the style name. On LTYPE rows: human-readable description string (e.g. Solid line, Dashed (.5x) _ _ _ _) as shown in the AutoCAD linetype dialog |
linetype[6] | 6 | Linetype name. Absent = BYLAYER |
style[7] | 7 | Text style name. References STYLE table |
layer[8] | 8 | Layer name. Present on all geometry entities |
pt[10] | 10 | Primary point. Single x,y or x,y,z for most entities. Space-delimited vertex list for LWPOLYLINE |
pt[11] | 11 | Second point -- LINE end, 3DFACE corner 2, TEXT alignment point, DIMENSION pt 2 |
pt[12] | 12 | Third point -- 3DFACE/SOLID corner 3. On SPLINE: start tangent vector (independently optional) |
pt[13] | 13 | Fourth point -- 3DFACE/SOLID corner 4, DIMENSION pt 4. On SPLINE: end tangent vector (independently optional) |
pt[14] | 14 | Fifth point -- DIMENSION pt 5 (first extension line start) |
pt[15] | 15 | Fifth point -- entity-scoped. Absent when no entity in the export uses this code |
pt[15] | 15 | Fifth point -- entity-scoped. On MULTILEADER (block-type): block content insertion point |
pt[110]-pt[112] | 110-112 | UCS axis vectors -- entity-scoped. On MULTILEADER (block-type): x-axis (pt[110]), y-axis (pt[111]), z-axis (pt[112]) defining block content orientation |
Elevation, thickness, transparency, scalars, angles, color basics (elev, thick, trans, real[40-43], angle[50/51/53], color/lwt/plotst/truecolor, seq)
| Header | Code | Meaning |
|---|---|---|
elev[38] | 38 | Elevation -- Z offset applied to all vertices of a flat entity (LWPOLYLINE, etc.) at draw time, rather than encoding Z in each vertex. Absent = 0. Combine with thick[39] for 2.5D extrusion: a LINE at z=0 with elev[38]=2.5 draws at z=2.5; add thick[39]=2.5 to extrude it 2.5 units further in Z |
thick[39] | 39 | Extrusion thickness -- Z depth applied to flat entities. Absent = 0. A LINE, ARC, or LWPOLYLINE with thick[39] becomes a surface extruded in the Z direction. Combined with elev[38], these two fields give flat entities a 2.5D presence without requiring 3D entities |
trans[440] | 440 | Entity transparency. Packed integer: top byte 0x02 = entity-level transparency type; lower 3 bytes = raw transparency value where 0 = fully opaque and 255 = fully transparent. Transparency percent ≈ (lower_byte / 255) × 100. Example: 0x02000026 = 38/255 ≈ 15% transparent. Absent = opaque. LAYER transparency uses a similar encoding |
real[40] | 40 | Floating scalar -- radius (CIRCLE/ARC), text height (TEXT/MTEXT), start width (POLYLINE), overall scale (MLINE) |
real[41] | 41 | Floating scalar -- x-scale (INSERT), end width (POLYLINE), text width factor (TEXT). On MTEXT: defined width (reference rectangle width, 0=undefined). On MLINE: element parameters comma-delimited |
real[42] | 42 | Floating scalar -- bulge (VERTEX/LWPOLYLINE), y-scale (INSERT). On MTEXT: actual height (AutoCAD-computed, read-only) |
real[43] | 43 | Floating scalar -- z-scale (INSERT), constant width (LWPOLYLINE). On MTEXT: actual width (AutoCAD-computed, read-only) |
angle[50] | 50 | Angle in degrees -- start angle (ARC), rotation (INSERT/TEXT), POINT display angle |
angle[51] | 51 | Angle in degrees -- end angle (ARC), oblique angle (TEXT) |
angle[53] | 53 | Angle in degrees -- entity-scoped. On HATCH: hatch pattern angle |
color[62] | 62 | ACI color index. Absent = BYLAYER. Negative = layer is frozen/off (use absolute value for color) |
lwt[370] | 370 | Lineweight in hundredths of a mm. Absent = DEFAULT (-3). Common values: 0=hairline, 5,9,13,15,18,20,25,30,35,40,50,53,60,70,80,90,100,106,120,140,158,200,211. Special: -1=BYLAYER, -2=BYBLOCK |
plotst[380] | 380 | Plot style index -- entity-level plot style assignment. Integer enumerator. Absent = BYLAYER. Passed through as-is; exact enumeration values are DXF-internal |
long[420] | 420 | True color as packed 24-bit RGB integer: (R << 16) | (G << 8) | B. When present, overrides color[62] for display. Absent = use color[62] (ACI). Present only when truecolor:rgb[420] is in the conditional metadata. Valid on both entity rows and LAYER table rows -- a LAYER row with long[420] sets the layer's true-color display independent of its ACI color[62] |
seq[66] | 66 | Sequence-follows flag. Always 1 when present. On POLYLINE rows: always required -- indicates VERTEX rows follow, terminated by SEQEND. On INSERT rows: required when ATTRIB rows follow, terminated by SEQEND; omit when no ATTRIBs follow. In both cases SEQEND will always be present after the sequence. Retained as a structural aid -- without it, a reader encountering an INSERT would require read-ahead to determine whether ATTRIB rows follow. |
Paper space, viewport, and text-position flags (paper[67], int[68-74], real[44-49], char[270])
| Header | Code | Meaning |
|---|---|---|
paper[67] | 67 | Paper-space layout index. Value identifies which paper space layout the entity belongs to: 1 = first layout (*Paper_Space, default Layout1), 2 = second layout (*Paper_Space0), 3 = third (*Paper_Space1), and so on -- the *Paper_Space BLOCK_RECORD name suffix increments as 0, 1, 2... for layouts beyond the first. Absent on model-space entities. Emitted on all paper-space entities including VIEWPORTs. CSVIN import planned: entities with paper[67]=2 and above are the target (multi-layout support) |
int[68] | 68 | VIEWPORT status flags |
int[69] | 69 | VIEWPORT ID |
int[70] | 70 | Integer flags -- entity-scoped. LAYER: 1=frozen, 2=frozen-in-new-viewports, 4=locked, 16=xref-dependent (layer from an attached xref -- appears in LAYER table but entities never reference it directly), 64=used. LWPOLYLINE: bit 0 (1)=closed, bit 7 (128)=plinegen (linetype generated continuously across all vertices rather than restarting per segment). POLYLINE: see mesh flags. VERTEX: see vertex flags. BLOCK: 0=regular, 1=anonymous (*-prefixed), 2=has-attributes (required when block contains ATTDEFs), 4=xref block definition (external reference -- geometry comes from the external file, entities inside not present in CSVOUT), 8=xref overlaid. MLINE: bit 0=closed, bit 1=suppress start caps, bit 2=suppress end caps |
int[71] | 71 | Integer -- POLYLINE mesh M vertex count, TEXT generation flags. On MTEXT: attachment point (1=TL, 2=TC, 3=TR, 4=ML, 5=MC, 6=MR, 7=BL, 8=BC, 9=BR) |
int[72] | 72 | Integer -- POLYLINE mesh N vertex count, TEXT/ATTRIB horizontal justification. On MTEXT: drawing direction (1=left-to-right, 3=top-to-bottom, 5=by style) |
int[73] | 73 | Integer -- TEXT vertical justification (0=baseline 1=bottom 2=middle 3=top). On MTEXT: line spacing style (1=at least, 2=exactly) |
int[74] | 74 | Integer -- ATTDEF/ATTRIB vertical justification. On MLINE: per-element parameter counts comma-delimited (absent when all elements have 2 parameters) |
real[44] | 44 | Floating scalar -- entity-scoped. On INSERT (array): column spacing. On SPLINE: fit tolerance. On MTEXT: line spacing factor (1.0=single, absent=not set) |
char[270] | 270 | Single-byte integer -- entity-scoped. On MULTILEADER: leader type indicator (2 in entmake, normalized to 0 by entget -- treat as opaque) |
real[45] | 45 | Floating scalar -- entity-scoped. On INSERT (array): row spacing. On HATCH: pattern line offset X component. On MTEXT: background fill scale factor (~1.0-3.0, 1.5 typical) -- only present as part of the background fill tail, see long[90]. On MULTILEADER: landing gap (absent when default) |
real[47] | 47 | Floating scalar -- entity-scoped. On HATCH: pixel size threshold -- present in CSVOUT, CSVIN computes internally from boundary flags, do not emit in AI-generated files. On MULTILEADER: line weight override (absent when default) |
real[46]-real[48] | 46-48 | Floating scalar -- entity-scoped. On HATCH: real[46] = pattern line offset Y component. On MTEXT: real[46] = defined column height (legacy field, 0/absent when not used). On DIMSTYLE rows: dimension variables |
real[48] | 48 | Linetype scale -- entity-level override of the global LTSCALE. Absent = use global scale |
real[49] | 49 | LTYPE element data -- comma-delimited list of dash/dot/gap lengths for non-CONTINUOUS linetypes. Positive = dash length, negative = gap length, zero = dot |
Extended entity flags, DIMSTYLE/MULTILEADER variables, mesh data (int[75-79], real[141/142], int[170-179], ext[210], long[90-94], real[140], int[63])
| Header | Code | Meaning |
|---|---|---|
int[75]-int[79] | 75-79 | Entity-scoped integers. On POLYLINE: int[75] = smooth surface type (0=none, 5=quadratic B-spline, 6=cubic B-spline, 8=Bezier). On HATCH: int[75]=pattern type, int[76]=associativity, int[77]=hatch style (0=normal, 1=outer, 2=ignore), int[78]=pattern line count, int[79]=pixel size. On DIMSTYLE rows: dimension style variables |
real[141] | 141 | Floating scalar -- entity-scoped. On ACAD_TABLE: row heights comma-delimited (nROW values). On DIMSTYLE: real[141]-real[147] dimension variables |
real[142] | 142 | Floating scalar -- entity-scoped. On ACAD_TABLE: column widths comma-delimited (nCOL values) |
int[170] | 170 | Integer -- entity-scoped. On DIMSTYLE: extended dimension variable. On MULTILEADER: combined leader type -- 2 fields (CONTEXT_DATA + common): 1=straight, 2=spline. Absent when both fields are default (1,1) |
int[171]-int[174] | 171-174 | DIMSTYLE integer variables (extended range) -- entity-scoped, only on DIMSTYLE rows |
int[175] | 175 | Integer -- entity-scoped. On MULTILEADER: combined text attachment -- 2 fields (CONTEXT_DATA + common). Absent when default (1,0) |
int[176]-int[178] | 176-178 | DIMSTYLE integer variables (extended range) -- entity-scoped, only on DIMSTYLE rows |
int[179] | 179 | Integer -- entity-scoped. On MULTILEADER: text angle type. Absent when default |
ext[210] | 210 | OCS extrusion normal vector -- x,y,z. Absent = default 0,0,1 (WCS). Applies to SOLID, CIRCLE, INSERT, and other entities in a non-WCS plane |
long[90] | 90 | Long integer -- entity-scoped. On MESH: combined face and edge data (see MESH entity). On MTEXT: background fill flag -- triggers a trailing fill tail (int[63] fill color, real[45] fill scale factor) when set to 1, 3, 16, or 17. When set to 2 (use drawing background color), only long[90] itself is present -- the fill tail is rejected by entmake in that case and must not be emitted. Absent or 0 = no background fill. On ACAD_TABLE: combined column -- field[0]=table flags (typically 22), field[1..N]=per-cell value flags (4=has content, 0=empty), where N=nROW×nCOL |
long[91] | 91 | Long integer -- entity-scoped. On MESH: subdivision level (absent when 0). On ACAD_TABLE: combined column -- field[0]=nROW (row count), field[1..N]=per-cell merged-row-span (262144=no merge) |
long[93] | 93 | Long integer -- entity-scoped. On MESH: face data count. On ACAD_TABLE: combined column -- field[0]=override count, field[1..N]=per-cell value type (6=content cell, 7=virtual/empty cell) |
long[94] | 94 | Long integer -- entity-scoped. On MESH: crease edge count |
real[140] | 140 | Floating scalar -- entity-scoped. On MESH: crease values comma-delimited, one per edge (int[94] values). Absent when all creases are 0.0 (flat mesh). On DIMSTYLE: real[140]-real[147] are floating-point dimension variables |
int[63] | 63 | Entity-scoped. On HATCH: fill color override (background color), comma-delimited when multiple loops have different fill colors |
Style overrides, MULTILEADER booleans, table/attribute strings (char[271/272/280-289], bool[290-296], int/long[95], string[302/304], long[92/93])
| Header | Code | Meaning |
|---|---|---|
char[271] | 271 | Single-byte integer -- entity-scoped. On DIMSTYLE: DIMDEC (decimal places for primary units) |
char[272] | 272 | Single-byte integer -- entity-scoped. On DIMSTYLE: DIMTDEC (decimal places for tolerance) |
char[280]-char[289] | 280-289 | Single-byte integers (0-255, RTCHAR). Entity-scoped. On PDFUNDERLAY: char[281]=contrast (0-100), char[282]=fade (0-80). On HELIX: char[280]=handedness (0=left, 1=right). On DIMSTYLE: various boolean-like flags. On ACAD_TABLE: char[280]=combined column (field[0]=blockref shadow always 0, field[1]=AcDbTable shadow -- absent when 0); char[281]=table style override flag (absent when 0). On ATTRIB: char[280]=combined 2 fields (field[0]=blockref shadow always 0, field[1]=lock/duplicate flag) |
bool[290] | 290 | Boolean (0/1) -- entity-scoped. On MULTILEADER: combined has-content/leader flags -- field[0]=has_content structural gate (0=no content, 1=with content); 2 fields when no leader, 3 fields when leader present |
bool[291] | 291 | Boolean (0/1) -- entity-scoped. On MULTILEADER: has-dogleg combined -- 3 fields (CONTEXT_DATA, LEADER{, common). Absent when all fields at default (0,1,1) |
bool[292] | 292 | Boolean (0/1) -- entity-scoped. On MULTILEADER: has-text-direction combined -- 2 fields (CONTEXT_DATA, common). Absent when default (0,0) |
bool[293] | 293 | Boolean (0/1) -- entity-scoped. On MULTILEADER: combined enable flags |
bool[295] | 295 | Boolean (0/1) -- entity-scoped. On MULTILEADER: text extend-to-leader (entmake 0, entget normalizes to 1 -- treat as opaque) |
bool[296] | 296 | Boolean (0/1) -- entity-scoped. On MULTILEADER: block attribute flag |
int[95] | 95 | Integer -- entity-scoped. On MULTILEADER: arrow style index in entmake (default 1; entget normalizes to 6 as long[95]). On MESH: crease count -- absent from CSV, derived by CSVIN from long[94] |
long[95] | 95 | Long integer -- entity-scoped. On MULTILEADER: arrow size as seen in entget (entmake accepts int[95]=1, entget returns 6). Absent when default |
string[302] | 302 | String -- entity-scoped. On ACAD_TABLE: per-cell text content (ncell tab-delimited fields including empty strings for virtual/empty cells). On MULTILEADER (block-type): block attribute values tab-delimited; when prefixed with LEADER{⇥, the prefix is a CSVIN skeleton marker, not a user value |
string[304] | 304 | String -- entity-scoped. On MULTILEADER: mtext text content. Absent when leaderless/compact or block-type. DXF sequence markers LEADER_LINE{ and } that share code 304 are skeleton literals injected by CSVIN -- never appear as CSV values |
long[92] | 92 | Long integer -- entity-scoped. On ACAD_TABLE: nCOL (column count, single value). On MULTILEADER: combined second flags column |
long[93] | 93 | Long integer -- entity-scoped. On MESH: face data count. On ACAD_TABLE: combined column -- field[0]=override count, field[1..N]=per-cell value type (6=content cell, 7=virtual/empty cell). On MULTILEADER: combined third flags column |
Gradient and true-color extras (long[95], long[421])
| Header | Code | Meaning |
|---|---|---|
long[95] | 95 | Long integer -- entity-scoped. On MULTILEADER: arrow size (entget value; entmake accepts int[95] default 1, entget normalizes to 6). Absent when default |
long[421] | 421 | Long integer -- entity-scoped. On HATCH gradient: packed 24-bit RGB color(s) comma-delimited (one per gradient color entry). Same bit layout as long[420]: (R << 16) | (G << 8) | B. Present only on gradient fill hatches. On MTEXT: packed 24-bit RGB override for background fill color -- same relationship to int[63] as long[420] has to color[62]: int[63] is always present when fill is active (ACI approximation), long[421] is present only when the fill color is a true-color RGB value, absent when fill color is an ACI. When present, long[421] overrides int[63] for display. On ACAD_TABLE: per-cell fill true-color override (ncell comma-delimited, absent when -1 for all cells) |
DIMSTYLE group code range: DIMSTYLE rows use a wide and evolving
range of group codes across real, int, char,
and pt prefixes. The codes listed above cover the most common variables
but AutoCAD adds dimension variables with each release. A DIMSTYLE row may contain
additional valid codes (e.g. char[277] DIMUNIT, char[280]
per-object linetype flag, pt[213] leader direction vector) not
individually documented here. All are valid -- read the column header and treat any
unknown DIMSTYLE code as a dimension variable to preserve round-trip.
Name-only table rows
Any table row (LAYER, LTYPE, STYLE, DIMSTYLE) may appear with only
name[2] populated and all other columns absent. This is a valid reference
-- it declares the name exists and CSVIN will create or verify the entry using
AutoCAD defaults. This pattern is common in AI-generated CSV when the consumer wants
to reference a standard AutoCAD resource (e.g. DIMSTYLE name[2]=ISO-25,
LTYPE name[2]=CENTER) without specifying every parameter.
Coordinates
All coordinates are raw drawing units -- no conversion applied. The
units: clause identifies the unit system.
Single-point entities (LINE, CIRCLE, ARC, INSERT, TEXT, POINT):
pt[10] contains one coordinate as x,y or x,y,z.
Multi-point entities (3DFACE, SOLID, TRACE, DIMENSION): use
pt[10] through pt[14], one coordinate per column.
LWPOLYLINE vertices: pt[10] contains all vertices
space-delimited -- x1,y1 x2,y2 x3,y3. Z is absent for 2D polylines;
elevation is in elev[38] (check file columns).
POLYLINE/VERTEX: vertices are on individual VERTEX rows following
the POLYLINE row, terminated by SEQEND. Each VERTEX has one coordinate in
pt[10]. The POLYLINE row itself carries only elevation in
pt[10] -- X and Y are always zero and carry no meaning.
Z-absent rule: CSVOUT follows DXF conventions -- flat entity
types (LWPOLYLINE, 2D ARC, etc.) do not include a Z component; 3D entity types
(POLYLINE/VERTEX, INSERT, etc.) always include Z. A missing Z means the entity type
is inherently flat. Z=0 means the entity type carries Z and it happens to be zero.
Consumers should treat both as equivalent for flat geometry -- 5,15 and
5,15,0 mean the same thing in practice. The coords:xy vs
coords:xyz metadata clause simply reflects which is present in this
file.
Bulge
Bulge encodes arc segments within polylines. Formula:
bulge = tan(included_angle / 4).
0= straight segment1= quarter circle (included = 4×atan(1) = 180°)- Positive = arc bows left of the direction of travel (CCW)
- Negative = arc bows right (CW)
- Very large absolute values (e.g. 437, 39073) indicate near-complete circles where the two endpoint vertices are very close together
To recover arc geometry from bulge b between points P1 and P2:
chord = distance(P1, P2) radius = chord / (2 * sin(2 * atan(|b|))) sagitta = chord/2 * |b|
In LWPOLYLINE: bulge values are comma-delimited in
real[42], one per vertex, in the same order as the space-delimited
vertices in pt[10].
In VERTEX rows: bulge is a single value in real[42]
on the VERTEX row it applies to.
Block structure
Block definitions are inline in the CSV between BLOCK and ENDBLK sentinel rows. They are not separate files.
BLOCK name[2]='WIDGET' layer[8]='0' pt[10]='0,0,0' <- definition starts LINE ... <- block geometry CIRCLE ... ENDBLK <- definition ends ... INSERT name[2]='WIDGET' pt[10]='100,200,0' angle[50]=45 <- placement in model space
To render a placed block: find the BLOCK definition matching name[2]
on the INSERT row, transform its geometry by the INSERT's position
(pt[10]), x/y/z scale (real[41]/real[42]/real[43],
absent = 1.0), and rotation angle (angle[50], absent = 0).
Block strip rules
Two categories of blocks are stripped from the output and never appear as BLOCK/ENDBLK definitions:
Anonymous blocks -- any block whose name begins with
*. These are AutoCAD-managed internal blocks. Examples:
*Model_Space, *Paper_Space, *D12 (dimension
rendered geometry), *U333 (utility blocks).
Empty blocks -- any block containing no geometry rows between BLOCK and ENDBLK, regardless of name. This includes user-defined blocks whose geometry has been deleted but whose definition was not cleaned up.
Anonymous block inclusion and -dxs interaction
By default, anonymous blocks are stripped. This includes *D##
dimension geometry blocks, which AutoCAD maintains as a dependent cache of rendered
dimension primitives. The DIMENSION entity referencing such a block remains in the
export -- the name[2] field will reference a block definition that is
not present. On import, the importer recreates the anonymous geometry from the
dimension parameters rather than restoring the cached primitives.
The -dxs flag controls which sections are exported. If the user
excludes the BLOCKS section entirely, or specifies named blocks only, no block
definitions will be present regardless of the anonymous strip rule. In all cases, an
INSERT or DIMENSION referencing an absent block definition is valid -- treat as a
zero-geometry placement, not an error.
Anonymous block inclusion is available as an export option -- when included,
anonymous blocks appear as BLOCK/ENDBLK pairs with *-prefixed names.
INSERT with no matching BLOCK definition
An INSERT or DIMENSION row whose name[2] has no matching BLOCK
definition in the file is valid -- the referenced block was stripped (anonymous or
empty) or excluded via -dxs. Treat it as a zero-geometry placement at
the specified position, scale, and rotation. Do not treat it as an error.
BLOCKS section states
The presence or absence of the BLOCKS section in the file is meaningful:
- BLOCKS section absent -- the user excluded blocks from this export
- BLOCKS section present, empty (
SECTION/ENDSECwith no BLOCK rows between) -- blocks were exported but no user-defined block definitions exist in the drawing - BLOCKS section present, with BLOCK/ENDBLK pairs -- user-defined block definitions are included
Note: AutoCAD always maintains at least *Model_Space internally, so
the BLOCKS section is never truly empty at the DWG level. An empty BLOCKS section in
the CSV means all definitions were stripped (anonymous or empty).
Structural sentinel rows
SECTION, ENDSEC, BLOCK, ENDBLK, and SEQEND are structural sentinels. They carry no
entity properties -- all columns are empty except type (and
name[2] on SECTION rows). Any properties that may exist on these rows in
the source DXF are bookkeeping artifacts and are stripped on export.
TABLE and ENDTAB are never emitted -- they exist in DXF
to wrap individual table sections but carry no information beyond what the enclosing
SECTION row already provides.
BLOCK and INSERT conventions
BLOCK int[70] flags: 0 = regular block (or omit),
1 = anonymous (*-prefixed, AutoCAD-managed), 2 = has attributes (required
when block contains ATTDEFs), 4 = xref block definition (external reference -- the
block's geometry lives in the external DWG file; no entities will appear inside this
BLOCK/ENDBLK pair in CSVOUT), 8 = xref overlaid. Must be set to 2 when the block
contains ATTDEFs -- this signals AutoCAD to prompt for attribute values on INSERT.
Omit or use 0 for blocks without ATTDEFs.
Color inside block definitions: entities inside a BLOCK should
use color[62]=0 (BYBLOCK) so the INSERT's own layer color propagates
into the block geometry at reference time. Entities with a specific ACI or true-color
override inside a block will always display that color regardless of INSERT layer --
use BYBLOCK for reusable symbols and specific colors only when the block is
intentionally hardcoded.
Nested blocks: a BLOCK definition may contain INSERT rows referencing other blocks -- nesting is supported. The nested INSERT appears as a normal INSERT row within the BLOCK/ENDBLK pair.
INSERT seq[66]: set to 1 when ATTRIB
rows follow the INSERT before SEQEND. When absent or 0, no ATTRIB rows follow and no
SEQEND is expected for that INSERT.
ATTDEF: defines an attribute template inside a
BLOCK. text[1] = default value, name[2] = tag (matched
against ATTRIB name[2] on INSERT), text[3] = prompt string.
int[70] flags: 0=visible, 1=invisible, 2=constant, 4=verify, 8=preset.
ATTRIB: carries a live attribute value on a specific
INSERT instance. Mirrors ATTDEF structure -- name[2] = tag,
text[1] = actual value, real[40] = text height,
pt[10] = text position. Must be followed by SEQEND (or another ATTRIB
then SEQEND) when seq[66]=1 is set on the INSERT.
SECTION/ENDSEC for TABLES and BLOCKS appear only when
the entire section is included via -dxs:
-dxs=TABLES→SECTION name[2]=TABLES/ENDSECwrap all table rows-dxs=TABLES(LAYER),TABLES(LTYPE)→ no SECTION/ENDSEC; LAYER and LTYPE rows appear directly-dxs=BLOCKS→SECTION name[2]=BLOCKS/ENDSECwrap all block definitions-dxs=BLOCKS('myblock')→ no SECTION/ENDSEC; BLOCK/ENDBLK for that block appears directly
SEQEND terminates a POLYLINE/VERTEX sequence or an INSERT/ATTRIB sequence. Its presence is preserved for human readability -- a reader can always infer termination from context, but the explicit row is kept because people look for it.
ATTRIB / ATTDEF
ATTDEF defines an attribute template inside a block definition. ATTRIB is the filled-in instance attached to an INSERT in model space.
name[2]= tag name (the attribute identifier, e.g.PART_NUMBER)text[1]= value on ATTRIB rows (the actual data, e.g.WD-4412)int[70]= attribute flags: 0=visible, 1=invisible, 2=constant, 4=verify, 8=presetint[72]= horizontal justification (same as TEXT)
ATTRIB rows immediately follow their parent INSERT row, before SEQEND. An INSERT
and its following ATTRIB rows always share the same space -- both model or both
paper. paper[67] will be consistent across the INSERT and all its
ATTRIBs.
Paper space
When space:model-and-paper is in the metadata, the file contains both
model-space and paper-space entities.
paper[67]=1on an entity means it lives in the default paper space layout (Layout1,*Paper_Spaceblock record).paper[67]=2= second layout (*Paper_Space0),paper[67]=3= third (*Paper_Space1), and so on- VIEWPORT entities define the viewports on the paper layout
- VIEWPORT
real[40]andreal[41]are viewport width and height in paper units - VIEWPORT
int[68]andint[69]are status flags and viewport ID - VIEWPORT entities are always paper space entities --
paper[67]=1is emitted on VIEWPORT rows. - Viewport layer overrides (per-viewport layer freeze, color, linetype) are not exported -- these are stored as handle lists in extended data and do not survive round-trip. The user sets them manually after import.
VIEWPORT creation workflow: CSVIN cannot create VIEWPORT entities
(acdbEntMake limitation -- permanent). For AI-assisted paper space
layout, place a LWPOLYLINE rectangle in paper space (paper[67]=1) at the
desired viewport position and size, with a TEXT entity on layer _ai
describing the view you want (orientation, scale, layers to freeze). The user creates
the actual viewport manually using the rectangle as a guide, then adjusts layer
visibility to match the directive. Example:
LWPOLYLINE, _ai, "2.5,1.5 14.5,1.5 14.5,9.5 2.5,9.5", paper[67]=1 <- viewport boundary guide TEXT, _ai, "Create viewport here: 3D isometric view, freeze layers: floorplan centerline labels", paper[67]=1, pt[10]="2.5,9.6"
Units reference
Value in units: | Drawing unit |
|---|---|
unitless | No unit system defined (code 0) |
in | Inches |
ft | Feet |
mi | Miles |
mm | Millimeters |
cm | Centimeters |
m | Meters |
km | Kilometers |
mil | Mils (thou, 1/1000 inch) |
yd | Yards |
us-ft | US Survey feet |
us-mi | US Survey miles |
unspecified | $INSUNITS absent from source DWG header |
Less common DXF unit codes (uin, angstrom, nm,
um, dm, dam, hm, Gm,
AU, ly, pc, us-in, us-yd)
are passed through using the same short-name pattern -- see the DXF specification for
the full enumeration.
ACI color reference
AutoCAD Color Index (ACI) -- integer 1-255. Common values:
| ACI | Color |
|---|---|
| 1 | Red |
| 2 | Yellow |
| 3 | Green |
| 4 | Cyan |
| 5 | Blue |
| 6 | Magenta |
| 7 | White / Black (display-dependent) |
| 8-255 | Extended palette |
| absent | BYLAYER |
| 0 | BYBLOCK |
| 256 | BYLAYER (explicit) |
Negative ACI in the LAYER table means the layer is frozen or off. Use
abs(value) for the display color.