feat(bedit): author visibility states of dynamic blocks

In the Block Editor, BVSTATE makes a new visibility state, makes one
current, renames or deletes one; BVHIDE and BVSHOW hide or show the
picked objects in the current state (BVSHOW shows every object of the
block while they are picked). The first use makes the block dynamic.

The states are stored as the format keeps them: a
BLOCKVISIBILITYPARAMETER in the block's ACAD_ENHANCEDBLOCK evaluation
graph with its visibility grip and the grip's two location expressions,
the round-trip purge preventer, AcDbDynamicBlockTrueName /
AcDbDynamicBlockGUID / AcDbBlockRepETag on the definition and element
tags on each of its objects. The definition shows its first state; a
reference given another state gets its own evaluated *U copy, tagged
AcDbBlockRepBTag and linked back through AcDbBlockRepresentation /
AcDbRepData, so it shows that state and the other references do not
change. Saving the block drops erased objects from the states.

Checked: a block authored this way reads back with its states and
reference link from DWG and DXF, and the ODA converter accepts the DWG.

Closes #1566

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-14 10:02:34 +03:00
1 parent 353c1b0d0f
commit da8e976a60
31 files changed
+1464 -1

No files matched your search

+13
View File
@@ -832,6 +832,19 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
"BACKGROUND colour [Default/Black/DarkGray/Gray/LightGray/White] or R G B (0–255):" => Some(("file", "background-colour-default-black-darkgray-gray")),
"BASE Specify base point:" => Some(("insert", "base-specify-base-point")),
"BEDIT Select block reference to edit:" => Some(("modify", "bedit-select-block-reference-to-edit")),
"BVSTATE Enter an option [New/Set/Rename/Delete] <Set>:" => Some(("modify", "bvstate-option")),
"BVSTATE Enter name of new visibility state:" => Some(("modify", "bvstate-new-name")),
"BVSTATE Enter visibility state to make current <{}>:" => Some(("modify", "bvstate-set")),
"BVSTATE Enter visibility state to rename <{}>:" => Some(("modify", "bvstate-rename-from")),
"BVSTATE Enter new name:" => Some(("modify", "bvstate-rename-to")),
"BVSTATE Enter visibility state to delete:" => Some(("modify", "bvstate-delete")),
"Visibility state \"{}\" not found." => Some(("modify", "bvstate-not-found")),
"Visibility state \"{}\" already exists." => Some(("modify", "bvstate-exists")),
"The only visibility state cannot be deleted." => Some(("modify", "bvstate-last")),
"{}: open the block in the Block Editor first (BEDIT)." => Some(("modify", "bvstate-needs-bedit")),
"Current visibility state: {}" => Some(("modify", "bvstate-current")),
"Select objects to hide:" => Some(("modify", "bvhide-select")),
"Select objects to make visible:" => Some(("modify", "bvshow-select")),
"ARRAYEDIT Select array:" => Some(("modify", "arrayedit-select-array")),
"ARRAYEDIT Enter an option [Source/eXit] <eXit>:" => Some(("modify", "arrayedit-options")),
"ARRAYEDIT: the selected object is not an associative array." => Some(("modify", "arrayedit-not-an-array")),