C++23 · every release, R10 to R2018 · ASCII and binary

Read and write DXF,nothing lost.

dxfio reads any AutoCAD drawing exchange file into plain C++ values, and writes it back unchanged or to any other release.

CMake
add_subdirectory(dxfio)
target_link_libraries(app PRIVATE dxfio::dxfio)

Command:

0 LINE0 CIRCLE0 POINT8 STROKE, GRIP

Nothing lost

Every group of every record comes back in its order. A kind with no type of its own is kept whole and written back as it came.

Every release

Read R10 to R2018 and save to any of them. What an older release lacks is drawn with what it has, as AutoCAD does, or reported.

Checked by AutoCAD

155 drawings AutoCAD 2026 wrote save back byte for byte, and what dxfio writes passes AutoCAD’s own audit.

Plain C++23

Aggregates and variants named after their DXF kinds, std::expected for failures, and edits that keep handles right.

In practice

Load, edit, save

Three calls carry a drawing from a file to any release, and the audit says whether AutoCAD will take it.

C++
#include "dxfio/dxfio.hpp"

auto loaded = DxfIO::LoadFile("plan.dxf");
if (!loaded)
{
  std::println("line {}: {}", loaded.error().Line, loaded.error().What);
  return 1;
}
DxfIO::Document &drawing = loaded->Document;

DxfIO::Tables::Layer walls{};
walls.Record.Name = "Walls";
DxfIO::Edit::Add(drawing, walls);

DxfIO::Entities::Line line{};
line.Record.Layer = DxfIO::Symbol{"Walls"};
line.End = DxfIO::Vector{.X = 100, .Y = 50, .Z = 0};
DxfIO::Edit::Add(drawing, line);

Compatibility

Ten releases, read and written

Every release AutoCAD has written since 1988 reads into the same document, and saves to any other. What each release keeps

  1. R101988AC1006
  2. R121992AC1009
  3. R131994AC1012
  4. R141997AC1014
  5. R20001999AC1015
  6. R20042003AC1018
  7. R20072006AC1021
  8. R20102009AC1024
  9. R20132012AC1027
  10. R20182017AC1032
Text in a code pageText in UTF-8Entities and tablesObjects, classes and handles