Drawing Sync Home Videos Getting Started Commands

DXF-CSV v1.0 Usage

How to actually generate, export, and import a DXF-CSV file -- from AutoCAD's ribbon, the command line, or an AI with no source drawing at all. For "how do I hand this to an AI," see the shorter AI Guide instead.

Generating a DXF-CSV file

DXF-CSV files have three sources:

The AI path is significant: a user can describe a design in plain language, share the spec URL, and receive a complete importable CSV. This has been demonstrated with mechanical brackets, electrical schematics, site plans, office furniture, and paper space layouts -- all generated as DXF-CSV without a source drawing.

Drawing Sync is available from the Autodesk App Store or by direct download:

Direct download: https://drawingsync.com/downloads/DrawingSync-2027-x64-Plugin.msi
Default install path: %ProgramFiles%\Code Truck\Drawing Sync\dwgsync.exe
The installer and all binaries are code-signed. After installing, run DSABOUT in AutoCAD to verify installation. Works with AutoCAD 2013 and later, within Autodesk's supported product lifecycle.

Basic usage

DXF-CSV files are created from AutoCAD and imported into AutoCAD.

Users create CSV files using the CSV Out button in the ribbon or by entering CSVOUT at the Command: prompt. Users can read CSV files created or modified by AI using the CSV In button in the ribbon or by entering CSVIN at the Command: prompt.

Dash commands -CSVOUT and -CSVIN offer additional options documented in the command reference.

Command line usage

dwgsync.exe supports batch and headless operation without opening the AutoCAD UI. AutoCAD must be installed to process .dwg files. .dxf files can be processed without AutoCAD.

Note for AI/automation calling this from a shell: dwgsync.exe is a Windows GUI executable, not a console app. On success with -q it exits silently -- exit code 0, no stdout or stderr. On invalid, incomplete, or unexpected arguments it can show a blocking modal dialog instead of printing an error -- a synchronous wait with no timeout will hang indefinitely. Run it with an explicit timeout and known-good argument patterns (below); if a call hangs, kill the dwgsync process rather than waiting on it. Running the exe with no arguments also shows a modal help dialog (not console text) listing available flags.

Exports and imports are fast even at real-world drawing sizes -- a ~5MB DWG with thousands of entities completed a full -dxs=TABLES,BLOCKS,ENTITIES export in under 20 seconds in testing. A 60-120 second timeout is generous for automation; anything that takes noticeably longer is a strong signal of a hung dialog, not genuine processing time.

dwgsync.exe accepts Unicode filenames and paths natively -- Windows process arguments are wide-character, and non-Latin-script filenames (Cyrillic, Arabic, etc.) work correctly. If a call unexpectedly hangs on a non-ASCII path, check your own argument-passing before suspecting the tool: some process-launch APIs (notably PowerShell's Start-Process -ArgumentList) mangle non-ASCII arguments before dwgsync.exe ever sees them, producing a hang that looks identical to the invalid-arguments case above but isn't one.

Export CSV from a drawing:

dwgsync.exe "sample.dwg" -q -dxc "sample.csv"
dwgsync.exe "sample.dxf" -q -dxs=TABLES,BLOCKS,ENTITIES -dxc "sample.csv"

Import CSV into a drawing:

dwgsync.exe sample.dwg -dsm sample.csv -dwg sample-out.dwg
dwgsync.exe new.dxf -dsm sample.csv -dxf sample-out.dxf
FlagMeaning
-qQuiet mode -- exit after processing without opening the AutoCAD UI
-dxc <path>Export CSV file path
-dsm <path>Merge CSV into the drawing
-dwg <path>Write output as a DWG file. AutoCAD must be installed
-dxf <path>Write output as a DXF file. Does not require AutoCAD

The positional source drawing argument must already exist, with exactly one exception: new.dxf. If the source argument is literally named new.dxf and no file exists at that path, Drawing Sync loads the minimal DXF template (sha1:781e2fb2654f) into memory and merges against that instead -- new.dxf itself is never written to disk. In most cases new.dxf should not already exist for this reason; if it does, it's used as an ordinary source file and the template substitution does not happen. Any other filename that doesn't exist is not substituted -- the call fails (or hangs on a dialog, per the note above) rather than falling back to a template. This makes new.dxf the right source for pure AI-generated content with no real drawing behind it -- whatever sha1 the CSV declares (e.g. sha1:396cb2c5a30e, the empty-AutoCAD-2018 template) is just metadata; CSVIN doesn't check it against the template it loads.

For anything else, the sha1: clause is mainly about making sure the right tables and blocks already exist in the target drawing. CSVIN is generally forgiving when they don't: a table the CSV references but doesn't define gets created with defaults, a referenced block becomes empty, rather than failing the import. Matching sha1, or targeting an ancestor of it, is what makes that unnecessary -- the drawing already carries the real definitions, so the CSV doesn't need to re-supply them.

dwgsync.exe "new.dxf" -dsm "sample.csv" -dwg "output.dwg" -q
dwgsync.exe "new.dxf" -dsm "sample.csv" -dxf "output.dxf" -q

When importing into a new or empty drawing this way, use the full -dxs export so all required table entries are present in the CSV.

Section filter -- -dxs

By default all sections are exported. The -dxs flag limits which sections and tables are included:

-dxs=TABLES(LAYER),ENTITIES                                     <- LAYER table only; no blocks; all entities -- same as omitting -dxs entirely (the default)
-dxs=TABLES(LAYER),BLOCKS,ENTITIES                              <- LAYER table only; all blocks; all entities
-dxs=TABLES,BLOCKS,ENTITIES                                     <- full drawing data; all tables, blocks, entities; recommended for import into drawings empty or unrelated to the `sha1:` source
-dxs=TABLES,ENTITIES                                            <- all tables; entities; no BLOCKS section
-dxs="TABLES(LTYPE),TABLES(STYLE),BLOCKS('block name')"         <- LTYPE and STYLE tables; one named block; quote when names have spaces
-dxs=BLOCKS('b1'),BLOCKS('b2')                                  <- two named blocks

Default behavior: when no -dxs is specified, CSVOUT defaults to TABLES(LAYER),ENTITIES -- always, regardless of what the drawing contains. BLOCKS is included only when explicitly requested. When BLOCKS is requested but the drawing has no block definitions to export, CSVOUT still emits an empty BLOCKS section (SECTION/ENDSEC with no BLOCK rows) rather than omitting it -- this is how a reader distinguishes "blocks were requested and there were none" from "blocks were never requested." A file exported without specifying LTYPE, LAYER, STYLE, or DIMSTYLE may reference tables by name without defining them -- CSVIN creates or verifies them using AutoCAD defaults on import.

Syntax rules:

For users -- exporting all data: when a drawing contains block definitions that should be included in the CSV, use Comma separated values ALL tables,blocks,entities (*.csv) in the standard file save dialog, or use the -CSVOUT dash command and select the All option. The default CSVOUT command omits block definitions unless -dxs explicitly requests them. If an AI reports that INSERT rows reference blocks that have no matching BLOCK definition in the file, re-export using the All option.

For AI -- missing block definitions: if a CSV contains INSERT rows but the BLOCKS section is empty or absent (SECTION/ENDSEC with no BLOCK rows between them), the block geometry was not included in the export. Do not attempt to infer or reconstruct the block geometry. Instead, inform the user that the file was exported without block definitions and ask them to re-export using Comma separated values ALL tables,blocks,entities (*.csv) or the -CSVOUT dash command All option.

-dxs=* raw dump: passing * as the section filter exports the full DXF -- HEADER, TABLES, BLOCKS, ENTITIES, and OBJECTS -- with no stripping. The output is a tabular CSV representation of the raw DXF group code stream, not a DXF-CSV v1.0 file. It has no #DXF-CSV v1.0 metadata line, includes handle columns (handle[5], id[330], etc.), subclass markers (class[100]), XDATA, and all bookkeeping that standard CSVOUT strips. Useful for DXF inspection and debugging -- not suitable for CSVIN import or AI generation workflows. An AI receiving a -dxs=* output should treat it as raw DXF tabular data rather than a conforming DXF-CSV file.

File structure

Encoding

Files are UTF-8 encoded with BOM (EF BB BF). The BOM is emitted by default by CSVOUT and should be preserved by any tool that reads and rewrites a DXF-CSV file. Non-ASCII characters (π, ±, °, and similar) are valid in text[1] and other string fields. AI consumers do not require the BOM and handle UTF-8 correctly without it. Tools that strip the BOM silently (some Unix pipelines, naive concatenation) may cause non-ASCII characters to display incorrectly in Excel and other consumer applications.

CSVOUT emits \r\n line endings by default (Windows convention). When creating or modifying a DXF-CSV file, \n (LF only) is preferred -- it is cleaner, avoids double-CR issues in text pipelines, and is accepted by both Excel and CSVIN.

Layout

type,layer[8],pt[10],pt[11],real[40],...        <- header row (row 0)
LINE,WALLS,10.0,20.0,5.0,...                    <- data rows
...
                                                <- blank separator line
#DXF-CSV v1.0 | audience:ai | source:... | ...  <- fixed metadata (always present)
#DXF-CSV-cond | space:model-and-paper | ...     <- conditional metadata (when conditions met)
#zombies:3DSOLID HELIX MESH WIPEOUT             <- zombie line (when zombies present)

A blank separator line -- entirely empty, no trailing comma -- is required between the last data row and the metadata lines. Without it, Excel and other table-aware tools treat the metadata as additional data rows and the table fails to parse cleanly; the blank line is what causes Excel to stop the table there, keeping metadata outside the formatted range. The three trailing lines that follow are all in the type column -- all other columns on those rows are empty.

Metadata string

Fixed clauses -- always present on #DXF-CSV v1.0 line

ClauseMeaning
#DXF-CSV v1.0Format identifier and version
audience:aiTerse encoding is intentional -- written for machine consumption
source:filename.dwg sha1:abc123def456Source drawing filename and 12-char SHA-1 content hash. Filename is unquoted when it contains no spaces. A filename containing a space is single-quoted: source:'my file.dwg'. A literal single quote in the filename is doubled: source:'rich''s file.dwg'. source: should always name a .dwg file -- it describes the origin drawing, not the CSV. For AI-generated content with no source drawing use source:generated.dwg paired with the appropriate sha1 sentinel.
codes:dxf-r12 or codes:dxf-2018DXF version of the source export. dxf-r12 = AutoCAD Release 12 entity set. dxf-2018 = AutoCAD 2018 format
dxfcsv:'https://drawingsync.com/dxfcsv/v1.0/spec.md'This document
last-updated:2026-07-12Build date of the CSVOUT binary that produced this file -- set at compile time. This date also identifies the spec version: a CSV carrying last-updated:2026-07-12 was produced by the build that corresponds to this edition of the spec. When the spec is updated, both this example date and the CSVOUT binary version advance together
units:xxDrawing units -- see Units reference
coords:xy z-absent=truly-2D or coords:xyz z-absent=truly-2DAll coordinates are raw drawing units. xy = all entities are 2D, no Z values present. xyz = 3D or mixed drawing, Z present on some or all entities. Z absent on a point means genuinely 2D -- not Z=0. See Coordinates
design:r12-extendedPost-R12 entities treated as R12-extended primitives. Handles, owners, subclass markers, CLASSES, OBJECTS stripped. See Design principle
color:aci absent=BYLAYERColor values are AutoCAD Color Index integers; absent cell means BYLAYER
missing:linetype=BYLAYER color=BYBLOCK lwt=-3Default values suppressed -- absent linetype means BYLAYER, absent color means BYBLOCK, absent lineweight means DEFAULT (-3)

Conditional clauses -- present on #DXF-CSV-cond line when conditions are met

ClausePresent when
blocks:inlineBlock definitions are present in this export -- inline between BLOCK/ENDBLK rows. Absent when the BLOCKS section was excluded via -dxs or the drawing has no block definitions
space:model-and-paperFile contains both model-space and paper-space entities
ext[210]:ocs-normal absent=0 0 1Any entity has a non-default OCS extrusion normal -- ext[210] column is present
mesh:polyline3D polygon mesh POLYLINEs present (legacy mesh, int[70] bit 4 set). int[71] and int[72] give M×N mesh dimensions on each POLYLINE row
mesh:subdivMESH entities present (subdivision mesh, post-2010 smooth mesh entity)
attrib:tag=name[2]ATTRIB or ATTDEF entities present -- tag identifier is in name[2]
paper[67]:paper-spaceFile contains paper-space entities -- paper[67]=1 on all paper-space entities
angle[51]:arc-end or text-obliqueARC entities or oblique TEXT present
bulge:tan(theta/4) in real[42]Bulge values present on VERTEX or LWPOLYLINE rows
seq[66]:sequence-followsAny POLYLINE or INSERT has a following VERTEX or ATTRIB sequence terminated by SEQEND
truecolor:rgb[420]Any entity uses true color (group 420) -- packed 24-bit RGB integer overriding ACI color
url:'https://github.com/org/repo.git'Source drawing is in a known git repository; sha1 doubles as git blob hash -- retrieve with git cat-file blob <sha1>

Zombie line -- present only when zombie entities exist

#zombies:TYPE1 TYPE2 TYPE3

Space-delimited, alphabetically sorted list of entity type names that exported as zombies -- entities whose geometry requires an object enabler that was not loaded. A zombie row will have no geometry columns but may have non-geometric properties (layer, color, linetype, style, paper space). Do not treat zombie rows as errors. See Design principle.


Drawing Sync ©2026 Code Truck LLC. All rights reserved