You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
craft-dwg: write AcDbVariableDictionary for AC1032 output too - #4971
What. The drawing variables dictionary (AcDbVariableDictionary) is added to 2018 (AC1032) DWGs too, not only older ones. ZWCAD 2025's AUDIT reports an AC1032 DWG without it as an error (storytold/cadcraft#2885).
Tests (crates/dwg): an_ac1032_dwg_gets_the_variable_dictionary (new here; the CADCraft PR tested it through cadcraft-io).
CADCraft side. CADCraft's crates/io/tests/dwg_required_dictionaries.rs has an_ac1032_dwg_stays_as_it_was, which expects no dictionary in a 2018 DWG. The rev move that brings this in needs that test turned round as the original PR did (an_ac1032_dwg_gets_the_variable_dictionary_too).
Verification (Linux x86-64, on craft-libs main092a2c6): rustfmt on the file, cargo clippy -p craft-dwg --all-targets -- -D warnings, cargo test -p craft-dwg all pass. Not run: Windows, macOS, wasm32, FreeBSD, and the CADCraft side, which needs the rev move. The craft-libs runners are stalled, so CI hasn't run yet.
Summary by CodeRabbit
Bug Fixes
AC1032 drawings now include the variables dictionary when it is missing.
No actionable comments were generated in the recent review.
Walkthrough
Changes
The DWG export path no longer skips adding AcDbVariableDictionary for AC1032 drawings. A test converts a minimal DXF to AC1032 DWG and checks the dictionary after reading the DWG back.
AC1032 variable dictionary
Layer / File(s)
Summary
Add and verify the variable dictionary crates/dwg/src/lib.rs
The AC1032 early return was removed. When the named-objects root is a dictionary and lacks AcDbVariableDictionary, the export path can add it. The test checks that the dictionary is present after conversion and read-back.
AC1032 DWG exports now include the variable dictionary, as other versions already did, which should fix the audit error reported in the linked issue. No merge-blocking risk was found in this crate.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: AcDbVariableDictionary is now written for AC1032 (2018) DWG output, matching the raw summary (add_variable_dictionary no longer skips AC1032) and the PR objectives. It…
Linked Issues check
[#2885] Requirement: a DWG written as AC1032 (2018) must contain AcDbVariableDictionary, so ZWCAD 2025 AUDIT reports zero errors. The keep-existing-dictionary rule must stay. The reviewed head's crate…
Out of Scope Changes check
The changes in crates/dwg/src/lib.rs are limited to add_variable_dictionary (AC1032 case removed, comments updated) and one test for the AC1032 dictionary. Both connect directly to #2885. The PR descr…
Full details: Title check
Explanation
The title names the main change: AcDbVariableDictionary is now written for AC1032 (2018) DWG output, matching the raw summary (add_variable_dictionary no longer skips AC1032) and the PR objectives. It also names the affected crate, craft-dwg. The title is short, specific, and does not describe anything absent from the changeset.
Full details: Linked Issues check
Explanation
[#2885] Requirement: a DWG written as AC1032 (2018) must contain AcDbVariableDictionary, so ZWCAD 2025 AUDIT reports zero errors. The keep-existing-dictionary rule must stay. The reviewed head's crates/dwg/src/lib.rs (whole-PR diff summary) shows that add_variable_dictionary no longer returns early for AC1032. When the named-objects root is a dictionary without AcDbVariableDictionary, it adds the dictionary for every version. The summary also states that the existing rule to keep an existing dictionary is unchanged. A test, an_ac1032_dwg_gets_the_variable_dictionary, checks AC1032 output for the dictionary. The file read was truncated at 16000 bytes, so I could not read the add_variable_dictionary body or the new test directly. The PASS rests on the diff summary and the PR description. Coding requirements are met by the crate change. The CADCraft test change named in the PR description is outside this repository and is not a requirement of this PR's crate-level scope.
Full details: Out of Scope Changes check
Explanation
The changes in crates/dwg/src/lib.rs are limited to add_variable_dictionary (AC1032 case removed, comments updated) and one test for the AC1032 dictionary. Both connect directly to #2885. The PR description and the diff summary report no unrelated edits. The CADCraft-side test rename is described as a follow-up that depends on a craft-libs rev move; it is not part of this repository diff. Verification was run on Linux only, which affects CI confidence but not scope.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 092a2c6 and 2baee54.
Files selected for processing: 1
crates/dwg/src/lib.rs
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of storytold/cadcraft#2886 by @assamaral. The DWG bridge moved here as
craft-dwgin storytold/cadcraft#3143, so thecrates/dwgpart of that PR is re-opened here, with the author credited as co-author of the commit.Fixes storytold/cadcraft#2885 once CADCraft moves its craft-libs
rev.What. The drawing variables dictionary (
AcDbVariableDictionary) is added to 2018 (AC1032) DWGs too, not only older ones. ZWCAD 2025's AUDIT reports an AC1032 DWG without it as an error (storytold/cadcraft#2885).Tests (
crates/dwg):an_ac1032_dwg_gets_the_variable_dictionary(new here; the CADCraft PR tested it throughcadcraft-io).CADCraft side. CADCraft's
crates/io/tests/dwg_required_dictionaries.rshasan_ac1032_dwg_stays_as_it_was, which expects no dictionary in a 2018 DWG. Therevmove that brings this in needs that test turned round as the original PR did (an_ac1032_dwg_gets_the_variable_dictionary_too).Verification (Linux x86-64, on craft-libs
main092a2c6):rustfmton the file,cargo clippy -p craft-dwg --all-targets -- -D warnings,cargo test -p craft-dwgall pass. Not run: Windows, macOS, wasm32, FreeBSD, and the CADCraft side, which needs therevmove. The craft-libs runners are stalled, so CI hasn't run yet.Summary by CodeRabbit