Document::Header holds every variable of the HEADER section in file order: its name, such as $INSUNITS, and the groups of its value. A small lookup finds one by name.
$INSUNITS is a whole number naming the unit of the drawing, which AutoCAD uses to scale blocks, images and xrefs inserted from a drawing of another unit. Among its values: 0 unitless, 1 inches, 2 feet, 4 millimeters, 5 centimeters, 6 meters (AutoCAD’s INSUNITS reference lists them all). A drawing from Create starts in millimeters.
C++
DxfIO::Header::Variable *units = variable(drawing, "$INSUNITS");std::println("$INSUNITS was {}", std::get<std::int64_t>(units->Values.front().Value));units->Values.front().Value = std::int64_t{6};
$LUNITS is the format AutoCAD shows lengths in: 1 scientific, 2 decimal, 3 engineering, 4 architectural, 5 fractional (AutoCAD’s LUNITS reference). $LUPREC is how many decimal places. Neither changes a coordinate in the file.