Skip to content

DWG writer follow-ups: arc length and jogged radius dimensions, Block Editor params, long texts, old writer removed - #18

Merged
SkryxDev merged 4 commits into
mainfrom
dwg-followups
Nov 14, 2026
Merged

SkryxDev merged 4 commits into
mainfrom
dwg-followups

Conversation

@SkryxDev

Copy link
Copy Markdown
Member

Follow-up to #16 (already merged): what was left on DraftCraft's own DWG writer.

What changes

  • Arc length and jogged radius dimensions are now written as AutoCAD's own types, ARC_DIMENSION and LARGE_RADIAL_DIMENSION, in DXF and in every DWG version (2000–2018). Their fields are laid out as AutoCAD 2027 writes them, and the same types are read back from AutoCAD's files. Partial arc lengths and the leader flag are kept. DraftCraft's older ARCLEN extended data still reads.
  • Dynamic blocks made in the Block Editor (BPARAMETER, BACTION) keep their parameters and actions through a DWG save. The Block Editor keeps the evaluation graph's node list (rebuild_graph), and dynblock_authoring.rs now saves both DXF and DWG.
  • Text longer than a DWG text field holds (65,535 units) is cut to that length, and the save reports how many entities were cut (textsShortened).
  • The old writer in crates/dwg/src/write is removed (−3000 lines). compose keeps the container and the small sections it used.

Checked in AutoCAD 2027

Each file was opened in AutoCAD 2027 and closed without saving. None needed recovery, and AUDIT reported 0 errors in all of them:

  • mi201 2018
  • dimensions 2000 and 2018: arc length and jogged radius dims list as AutoCAD's own types
  • hatches 2007 and 2018
  • mlines 2013
  • regions 2007
  • viewports 2007 and 2018: the layout viewports show the model

AutoCAD's own save of our mi201 2018 file reads in DraftCraft the same as ours. The image files were not checked.

Tests

  • cargo clippy --workspace --all-targets -D warnings: clean.
  • io, dwg, doc and engine tests: all pass, except the known macOS-only failures (read_file_refuses_a_name_that_is_not_unicode, usage::non_unicode_output_names, thai_marks_stack_in_an_installed_font).
  • New tests:
    • DWG field order of both dimension types in R2000 and R2018
    • DXF and DWG round trip of partial arc length and jogged radius
    • reading the records as AutoCAD writes them
    • reading the older ARCLEN form

🤖 Generated with Claude Code

SkryxDev and others added 4 commits November 14, 2026 14:15
A text over 65,535 characters (UTF-16 units from 2007, bytes before) keeps
only its start in a DWG file. SAVE, SAVEAS, QSAVE and EXPORT now say how
many entities that happens to, at the command line and as textsShortened,
instead of cutting them silently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a DWG save

The Block Editor now rebuilds the evaluation graph's node list (id, flags, next id, member,
links) whenever a parameter or action is added or removed, which is what the DWG encoder
writes from. The authoring test saves both DXF and DWG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ections it used

crates/dwg/src/write (the writer over BlackCAD's records) had no caller left but compose and
the style encoders. The paged container moves to compose/container.rs, the application
information, revision history and header defaults to compose/small.rs, and the three-stream
field writer the style encoders use to compose/fields.rs. The rest (object encoders, check,
the AC1032 file builder) goes, with what only it used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…F and DWG

An arc length dimension is written as ARC_DIMENSION (AcDbArcDimension: centre, arc ends,
angles, partial and leader flags) and a jogged radius as LARGE_RADIAL_DIMENSION
(AcDbRadialDimensionLarge: chord point, override centre, jog), in DXF and in every DWG
version, laid out as AutoCAD 2027 writes them; both are read back from AutoCAD's files.
DraftCraft's older ARCLEN extended data still reads. AutoCAD 2027 opens the dimensions
fixture with AUDIT 0 and lists both as its own types; the handoff notes the fixtures
checked in AutoCAD since PR #16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SkryxDev
SkryxDev requested a review from withshalom November 14, 2026 14:07
@SkryxDev
SkryxDev merged commit e92d135 into main Nov 14, 2026
1 check passed
@SkryxDev
SkryxDev deleted the dwg-followups branch November 14, 2026 16:37
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