forked from 1b-agent/opencadstudio-upstream
fix(blocks): a dynamic block copied to another drawing stays dynamic (#1816)
Only the definition's entities crossed drawings: its record's object graph (parameters, visibility states, grips) stayed behind, and a reference showing an evaluated copy lost the link to its definition. The clipboard now captures the graph and the dynamic definition of an evaluated reference, and paste and the block palette's insert-from-file recreate them on the new records, re-pointing members and element tags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca408f4329
commit
091331f3bd
6 files changed
+109
-21
No files matched your search
@@ -521,11 +521,7 @@ impl Scene {
|
||||
record.flags.anonymous = true;
|
||||
let copy = record.handle;
|
||||
// The copies keep their element ids, now naming themselves.
|
||||
for handle in members(&self.document, copy) {
|
||||
if let Some(id) = self.document.get_entity(handle).and_then(element_id) {
|
||||
set_entity_tag(&mut self.document, handle, element_tag(id, handle));
|
||||
}
|
||||
}
|
||||
super::block_authoring::retag_members(&mut self.document, copy);
|
||||
let mut tag = ExtendedDataRecord::new(REPRESENTATION_TAG);
|
||||
tag.add_value(XDataValue::Integer16(1));
|
||||
tag.add_value(XDataValue::Handle(definition));
|
||||
|
||||
Reference in new issue
Block a user