mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 16:01:36 +00:00
ifc_duplicate_operator now remove the connections with old objects. Similar solutions presented in PR #3789
This commit is contained in:
@@ -811,6 +811,9 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
||||
if old.is_a("IfcElementAssembly"):
|
||||
OverrideDuplicateMove.recreate_assembly(old_to_new)
|
||||
|
||||
# Remove connections with old objects
|
||||
OverrideDuplicateMove.remove_old_connections(old_to_new)
|
||||
|
||||
# Recreate decompositions
|
||||
tool.Root.recreate_decompositions(relationships, old_to_new)
|
||||
blenderbim.bim.handler.refresh_ui_data()
|
||||
@@ -867,6 +870,17 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
||||
related_obj=tool.Ifc.get_object(new_element[0]),
|
||||
)
|
||||
|
||||
def remove_old_connections(old_to_new):
|
||||
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)
|
||||
|
||||
|
||||
class OverrideDuplicateMoveLinkedMacro(bpy.types.Macro):
|
||||
bl_idname = "bim.override_object_duplicate_move_linked_macro"
|
||||
|
||||
Reference in New Issue
Block a user