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.
C++23 · every release, R10 to R2018 · ASCII and binary
dxfio reads any AutoCAD drawing exchange file into plain C++ values, and writes it back unchanged or to any other release.
CMakeadd_subdirectory(dxfio)
target_link_libraries(app PRIVATE dxfio::dxfio)
C++#include "dxfio/dxfio.hpp"
auto loaded = DxfIO::LoadFile("plan.dxf");
Command:
0 LINE0 CIRCLE0 POINT8 STROKE, GRIP
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.
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.
155 drawings AutoCAD 2026 wrote save back byte for byte, and what dxfio writes passes AutoCAD’s own audit.
Aggregates and variants named after their DXF kinds, std::expected for failures, and edits that keep handles right.
In practice
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);
C++const auto older = DxfIO::SaveFile(drawing, "plan-r12.dxf", {.Release = DxfIO::Version::R12});
for (const DxfIO::Issue &issue : older.value_or(std::vector<DxfIO::Issue>{}))
{
std::println("{}", issue.What);
}
C++const DxfIO::Audit::Report report = DxfIO::Audit::Check(drawing);
std::println("{} errors, {} warnings", report.Errors(), report.Warnings());
Compatibility
Every release AutoCAD has written since 1988 reads into the same document, and saves to any other. What each release keeps
AC1006AC1009AC1012AC1014AC1015AC1018AC1021AC1024AC1027AC1032