diff --git a/src/blenderbim/blenderbim/bim/module/geometry/operator.py b/src/blenderbim/blenderbim/bim/module/geometry/operator.py index cd0d147e94..0c3304e59e 100644 --- a/src/blenderbim/blenderbim/bim/module/geometry/operator.py +++ b/src/blenderbim/blenderbim/bim/module/geometry/operator.py @@ -1109,6 +1109,17 @@ class OverrideDuplicateMoveAggregate(bpy.types.Operator): 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 = [] for old, new in old_to_new.items(): old_objs.append(tool.Ifc.get_object(old)) @@ -1255,6 +1266,18 @@ class RefreshAggregate(bpy.types.Operator): for parent in parents: 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 = [] for old, new in old_to_new.items(): old_objs.append(tool.Ifc.get_object(old))