mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
remove connections with old objects when duplicating aggregates
This commit is contained in:
committed by
Dion Moult
parent
38f5468f19
commit
be2c7a62fd
@@ -1109,6 +1109,17 @@ class OverrideDuplicateMoveAggregate(bpy.types.Operator):
|
|||||||
|
|
||||||
recreate_data_structure(new_root_entity)
|
recreate_data_structure(new_root_entity)
|
||||||
|
|
||||||
|
# Remove connections with old objects
|
||||||
|
for new in old_to_new.values():
|
||||||
|
for connection in new[0].ConnectedTo:
|
||||||
|
entity = connection.RelatedElement
|
||||||
|
if entity in old_to_new.keys():
|
||||||
|
core.remove_connection(tool.Geometry, connection=connection)
|
||||||
|
for connection in new[0].ConnectedFrom:
|
||||||
|
entity = connection.RelatingElement
|
||||||
|
if entity in old_to_new.keys():
|
||||||
|
core.remove_connection(tool.Geometry, connection=connection)
|
||||||
|
|
||||||
old_objs = []
|
old_objs = []
|
||||||
for old, new in old_to_new.items():
|
for old, new in old_to_new.items():
|
||||||
old_objs.append(tool.Ifc.get_object(old))
|
old_objs.append(tool.Ifc.get_object(old))
|
||||||
@@ -1255,6 +1266,18 @@ class RefreshAggregate(bpy.types.Operator):
|
|||||||
for parent in parents:
|
for parent in parents:
|
||||||
duplicate_children(parent)
|
duplicate_children(parent)
|
||||||
|
|
||||||
|
|
||||||
|
# Remove connections with old objects
|
||||||
|
for new in old_to_new.values():
|
||||||
|
for connection in new[0].ConnectedTo:
|
||||||
|
entity = connection.RelatedElement
|
||||||
|
if entity in old_to_new.keys():
|
||||||
|
core.remove_connection(tool.Geometry, connection=connection)
|
||||||
|
for connection in new[0].ConnectedFrom:
|
||||||
|
entity = connection.RelatingElement
|
||||||
|
if entity in old_to_new.keys():
|
||||||
|
core.remove_connection(tool.Geometry, connection=connection)
|
||||||
|
|
||||||
old_objs = []
|
old_objs = []
|
||||||
for old, new in old_to_new.items():
|
for old, new in old_to_new.items():
|
||||||
old_objs.append(tool.Ifc.get_object(old))
|
old_objs.append(tool.Ifc.get_object(old))
|
||||||
|
|||||||
Reference in New Issue
Block a user