Introduction
DXF is Autodesk’s documented format for exchanging drawings between AutoCAD and other programs, introduced alongside AutoCAD in 1982. Unlike DWG, its layout is published with every AutoCAD release, so it is widely supported. It is the usual format for sending outlines to laser cutters, CNC routers and plasma cutters.
Most DXF files are text. A binary form also exists, which starts with the line
AutoCAD Binary DXF.
Structure
A text DXF file is a long series of pairs, each on two lines: a group code, which is
a number saying what kind of value follows, then the value. Code 0 starts
a new entity or marks a section boundary, 2 gives a name, 8
gives a layer, and 10, 20 and 30 give the X, Y
and Z of a point.
The pairs are grouped into sections, each opened by 0 SECTION and closed
by 0 ENDSEC: HEADER for drawing settings,
CLASSES, TABLES for layers, line types and styles,
BLOCKS for reusable groups of entities, ENTITIES for the
drawing itself and OBJECTS. The file ends with 0 EOF.
0
SECTION
2
ENTITIES
0
LINE
8
Outline
10
0.0
20
0.0
11
100.0
21
50.0
0
ENDSEC
0
EOF
In this reference
- Structure and group codes – pairs, sections and the rules for writing files, version numbers, every group code range and value type, the group codes in numerical order, tables and handles, binary DXF and object coordinate systems
- Header variables – every HEADER variable with its group code and values, the revised VPORT variables, and how dates and times are stored
- Classes, tables and blocks – CLASS records and proxy flags, AutoCAD’s default classes, every symbol table and its flags, BLOCK and ENDBLK
- Entities – the codes common to all entities, then the group codes of every entity from 3DFACE to XLINE
- Objects – the codes common to all objects, every object from ACAD_PROXY_OBJECT to XRECORD, the thumbnail image and extended data
The reference pages follow Autodesk’s DXF Reference for AutoCAD 2012 and 2014;
2014 is the newest edition published as a PDF. The 2018 online edition adds the
version AC1032.
Not described
Known, not yet covered
- Reference: the values of codes that the AutoCAD 2014 DXF Reference names but does not list: objects (VISUALSTYLE 70; TABLESTYLE 71, 90, 91 and 170; SUNSTUDY 70 and 74; FIELD 90; GEODATA 91 and 92; DIMASSOC 71, 73 and 74; MATERIAL 460 onwards and the section objects’ type and flag codes) and tables (BLOCK_RECORD 70, 280 and 281; VPORT 70, 74 and 170; VIEW and VPORT 71; STYLE 1071; DIMSTYLE 276). Later Autodesk help pages and DXF libraries may list some of them; those were not read for these pages.
- Reference: changes made after the 2014 reference, the newest Autodesk publishes as a PDF. The pages list version
AC1032but follow the 2014 text; later releases are documented only in Autodesk’s HTML help. - Viewer: none yet; the site shows the hex viewer only.
Unknown
- Reference: points the reference’s own text leaves unclear, which real files would have to settle: the pairing of some MLEADER and LIGHT group codes, OLE2FRAME group 3, HELIX and loft entity data order, TABLE codes 302 and 303, PLOTSETTINGS 48 and 140 (and 49 and 141), and which description belongs to which angular, radius or diameter dimension (list).
Links
Software
- AutoCAD – Autodesk’s CAD program, where DXF comes from (Windows, macOS)
- LibreCAD – free open source 2D CAD program that works in DXF (Windows, macOS, Linux)
- QCAD – 2D CAD program that works in DXF (Windows, macOS, Linux)
- FreeCAD – free open source parametric CAD program (Windows, macOS, Linux)
- Inkscape – free vector graphics editor that imports and exports DXF (Windows, macOS, Linux)
- BricsCAD – CAD program compatible with AutoCAD files (Windows, macOS, Linux)
- Autodesk Fusion – Autodesk’s CAD and CAM program, which exports sketches as DXF (Windows, macOS)