DWG: entities of a second layout stay on it in AutoCAD (#1057) (#1080)

acadrust writes every paper-space entity with entity mode 1 ("paper
space"), including those of *Paper_Space0, *Paper_Space1… and relies on
each block's entity list; AutoCAD reads mode 1 as the *Paper_Space
block's, so what was drawn on a second layout (and its viewports, in
drawings from AutoCAD with several layouts) landed on the first one, and
the second stayed empty. The DWG bridge now writes those entities owned
by their block (entity mode 0 with the owner handle), as the public DWG
specification describes; the first layout's entities stay mode 1.

The io tests read CADCraft's DWG back with acadrust (a dev-dependency,
the same version as cadcraft-dwg's) to check the modes as written.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aldozar
2026-10-19 02:28:58 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 632c2d4f1f
commit 162d5c6820
4 changed files with 81 additions and 0 deletions
Generated
+1
View File
@@ -663,6 +663,7 @@ dependencies = [
name = "cadcraft-io"
version = "0.9.0"
dependencies = [
"acadrust",
"cadcraft-color",
"cadcraft-doc",
"cadcraft-dwg",