mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
merged the branch 'improvements-on-override-duplicat'
This commit is contained in:
@@ -870,32 +870,6 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
|||||||
|
|
||||||
return arrays_to_create, array_children
|
return arrays_to_create, array_children
|
||||||
|
|
||||||
# @staticmethod
|
|
||||||
# def recreate_assembly(old_to_new):
|
|
||||||
# for old, new in old_to_new.items():
|
|
||||||
# old_aggregate = ifcopenshell.util.element.get_aggregate(old)
|
|
||||||
# if old_aggregate:
|
|
||||||
# new_aggregate = old_to_new[old_aggregate]
|
|
||||||
# blenderbim.core.aggregate.assign_object(
|
|
||||||
# tool.Ifc,
|
|
||||||
# tool.Aggregate,
|
|
||||||
# tool.Collector,
|
|
||||||
# relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
|
||||||
# related_obj=tool.Ifc.get_object(new[0]),
|
|
||||||
# )
|
|
||||||
|
|
||||||
# # Make sure that the array children also get reassigned to the correct aggregate
|
|
||||||
# pset = ifcopenshell.util.element.get_pset(new[0], "BBIM_Array")
|
|
||||||
# if pset:
|
|
||||||
# array_children = tool.Blender.Modifier.Array.get_all_children_objects(new[0])
|
|
||||||
# for obj in array_children:
|
|
||||||
# blenderbim.core.aggregate.assign_object(
|
|
||||||
# tool.Ifc,
|
|
||||||
# tool.Aggregate,
|
|
||||||
# tool.Collector,
|
|
||||||
# relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
|
||||||
# related_obj=tool.Ifc.get_object(tool.Ifc.get_entity(obj)),
|
|
||||||
# )
|
|
||||||
|
|
||||||
def remove_old_connections(old_to_new):
|
def remove_old_connections(old_to_new):
|
||||||
for new in old_to_new.values():
|
for new in old_to_new.values():
|
||||||
@@ -1032,27 +1006,12 @@ class DuplicateMoveLinkedAggregate(bpy.types.Operator):
|
|||||||
|
|
||||||
old_to_new = OverrideDuplicateMove.execute_ifc_duplicate_operator(self, context, linked=True)
|
old_to_new = OverrideDuplicateMove.execute_ifc_duplicate_operator(self, context, linked=True)
|
||||||
|
|
||||||
# TODO check how this will interact with the new code from duplicate operator
|
|
||||||
for old_element, new_element in old_to_new.items():
|
# Recreate assembly relationship
|
||||||
old_aggregate = ifcopenshell.util.element.get_aggregate(old_element)
|
for old in old_to_new.keys():
|
||||||
if old_aggregate:
|
if old.is_a("IfcElementAssembly"):
|
||||||
if old_element.GlobalId == selected_element.GlobalId:
|
tool.Root.recreate_assembly(old_to_new)
|
||||||
blenderbim.core.aggregate.unassign_object(
|
|
||||||
tool.Ifc,
|
|
||||||
tool.Aggregate,
|
|
||||||
tool.Collector,
|
|
||||||
relating_obj=tool.Ifc.get_object(old_aggregate),
|
|
||||||
related_obj=tool.Ifc.get_object(new_element[0]),
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
new_aggregate = old_to_new[old_aggregate]
|
|
||||||
blenderbim.core.aggregate.assign_object(
|
|
||||||
tool.Ifc,
|
|
||||||
tool.Aggregate,
|
|
||||||
tool.Collector,
|
|
||||||
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
|
||||||
related_obj=tool.Ifc.get_object(new_element[0]),
|
|
||||||
)
|
|
||||||
|
|
||||||
blenderbim.bim.handler.refresh_ui_data()
|
blenderbim.bim.handler.refresh_ui_data()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user