Skip to content

Preserve IFCCAD DWG XREF sources and placements - #30

Merged
HakanSeven12 merged 4 commits into
HakanSeven12:mainfrom
BjornFidder:ifccad-xrefs
Nov 20, 2026
Merged

HakanSeven12 merged 4 commits into
HakanSeven12:mainfrom
BjornFidder:ifccad-xrefs

Conversation

@BjornFidder

@BjornFidder BjornFidder commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Map external DWG source definitions and Model INSERTs to native IFCCAD XREFs without flattening loaded source geometry. Context-aware saves retain source/entity IDs, original URI spelling, the expected fingerprint GUID, source base/unit and O/X/Y placement with one effective scale, including offline save/reopen.

The shared location helpers distinguish URI references from search filenames and perform path escaping once. CAD export rejects URI forms with no qualified DWG/DXF path mapping. Unsupported reference semantics receive explicit conversion diagnostics.

Dependencies

Requires IFCCAD main commit 96895aea607e3f2a54f9b286115844554f59df77 (profile 0.12.0 / CBOR 12). The codec now uses official upstream revision a7d378502748e6428655aa091306f01f7f3a17a9, including hakanaktt/acadrust#533. The temporary fork review pin is removed from Cargo.toml and Cargo.lock. No machine-local path overrides are submitted.

The current upstream Document dependency updates are merged through 41b870fb, preserving its newer official codec pin rather than downgrading it. Codec changes since the review pin include Civil TIN/alignment/profile APIs and FileDepList reader improvements for section flags, UCS-4 strings and graphics-flag padding. The typed dependency record and Document entity fields remain unchanged. Civil proxy entities retain the existing explicit omission diagnostics; no new Civil conversion coverage is claimed.

Validation

The pinned local development pair passed all six Document CI configurations on 19 November 2026, including the IFCX/preservation feature combination. Focused tests cover strict native readback, physical DWG/DXF return, source base and effective scale, URI/search behavior, IDs, GUID retention and unsupported semantics. Desktop/browser tests and user manual XREF verification passed with the matching Studio candidate.

On 20 November this draft was refreshed against Document main 7e3fcc4 and codec main 9517c6f, preserving the new upstream functionality. Public dependency resolution, including all features, confirms exactly one native and one codec identity. The earlier local-pair results are historical evidence for the first slice.

DXF output follows the current codec/Studio policy for dependency GUIDs; this contribution adds no private DXF extension or extra GUID-loss warning. AutoCAD-authored known-GUID fixture qualification remains separate.

Whole DWG sources and planar positive uniform Model attachments only. DXF/IFCCAD sources, nested graphs, overlay, bind, packaging and SHX/CTB/STB migration are follow-up work. This draft is not a release or deployment.

The official codec-pin update passes cargo fmt --all -- --check and the complete cargo test --locked --features serde,mline-pilot locally, including strict native readback, physical CAD, XREF and location regressions and doctests. Locked feature-enabled metadata confirms exactly one codec from the official upstream repository and native IFCCAD from the staged public commit; no local source patches were selected. Fresh GitHub platform/WASM CI is pending on this dependency-only update.

@BjornFidder
BjornFidder marked this pull request as ready for review November 20, 2026 10:32
@HakanSeven12
HakanSeven12 merged commit 6807669 into HakanSeven12:main Nov 20, 2026
4 checks passed
@HakanSeven12

Copy link
Copy Markdown
Owner

Merged in 6807669, thanks. The XREF tests pass locally with ifcx,mline-pilot. Overlay and DXF XREFs are now kept out of the IFCCAD export as noted losses instead of being written as blocks, which matches the PR's scope. OCS picks this up with the next opencaddocument pin, together with #3379 once it leaves draft.

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.

2 participants