Skip to content

feat: decode AcDb:Header system variables and drawing units - #73

Merged
mahach666 merged 4 commits into
mainfrom
feat/header-variables
Dec 2, 2026
Merged

mahach666 merged 4 commits into
mainfrom
feat/header-variables

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Summary

  • Add DwgHeaderVariables, DwgInsUnits, DwgPoint2D, DwgPoint3D, and HeaderParser to decode core AcDb:Header variables across R2004 (inline strings) and R2007–R2018 (separate UTF-16 string stream):
    • $INSUNITS (TryGetSceneUnit()), $MEASUREMENT (mirrored from AcDb:Template), $INSBASE, $EXTMIN, $EXTMAX, $LIMMIN, $LIMMAX
    • $LUNITS, $LUPREC, $AUNITS, $AUPREC, $PDMODE, $PDSIZE, $LTSCALE, $TEXTSIZE, $CELTSCALE, $DIMSCALE, $CECOLOR, $CELWEIGHT
    • $TDCREATE, $TDUPDATE, $HANDSEED, $MENUNAME, $FINGERPRINTGUID, $VERSIONGUID
  • Add DwgReaderOptions.ReadHeader (default true) and expose DwgDocument.HeaderVariables.
  • Export headerVariables in DwgJsonExporter and summarize key header settings in dwgio inspect.
  • Add DwgSceneOptions.UseDrawingUnits (default false for API compatibility; enabled automatically by dwgio CLI exports when --unit is omitted) and emit pdmode / insunits in the 2D AutoCAD HTML viewer.
  • Share ReadUtf16String / ReadCodepageString helpers on BitReaderMsb between ClassesParser and HeaderParser.
  • Add HeaderVariablesTests covering R2010/R2013/R2018 public fixtures, synthetic R2004 inline headers, scene unit mapping, JSON/CLI/viewer integration, and malformed headers.

Stacked on #72.

Verification

  • dotnet build DwgIO.slnx -c Release — 0 warnings, 0 errors
  • dotnet test DwgIO.slnx -c Release --no-build — 274 passed, 0 failed, 1 skipped (unconfigured private fixtures) on both net8.0 and net10.0
  • BuildNativeCoreOnly=true passed cleanly for both DwgIO.csproj and DwgIO.Scene.csproj

@mahach666
mahach666 changed the base branch from feat/classes-and-2d-entities to main December 2, 2026 10:40
@mahach666
mahach666 merged commit c308d67 into main Dec 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant