forked from 1b-agent/opencadstudio-upstream
fix(blocks): reopen evaluated references in their authoring definition
Resolve BEDIT reference entry through the native dynamic-definition link instead of editing the anonymous geometry variant. Preserve static-block fallback and existing lock/xref checks. Add synthetic regressions for evaluated-reference DWG reload and save/close/reedit, plus Rotation-only save/close/reopen followed by Flip placement. Validated with 334 block tests passing (6 existing opt-in tests ignored).
This commit is contained in:
1 parent
de7ed432fb
commit
1ee432ac64
2 files changed
+122
-1
No files matched your search
@@ -536,7 +536,17 @@ impl OpenCADStudio {
|
||||
return Some(Task::none());
|
||||
}
|
||||
match self.tabs[i].scene.document.get_entity(insert_handle) {
|
||||
Some(codec::EntityType::Insert(ins)) => ins.block_name.clone(),
|
||||
Some(codec::EntityType::Insert(ins)) => {
|
||||
// Evaluated INSERTs point at anonymous geometry variants.
|
||||
// Their authoring graph belongs to the original definition.
|
||||
let doc = &self.tabs[i].scene.document;
|
||||
doc.dynamic_definition_for_insert(insert_handle)
|
||||
.and_then(|definition| {
|
||||
doc.block_records.iter().find(|br| br.handle == definition)
|
||||
})
|
||||
.map(|br| br.name.clone())
|
||||
.unwrap_or_else(|| ins.block_name.clone())
|
||||
}
|
||||
_ => {
|
||||
self.command_line.push_error(
|
||||
crate::t!("BEDIT: selected object is not a block reference.")
|
||||
|
||||
Reference in new issue
Block a user