mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
recreates assembly for array children objects
This commit is contained in:
@@ -858,17 +858,30 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def recreate_assembly(old_to_new):
|
def recreate_assembly(old_to_new):
|
||||||
for old_element, new_element in old_to_new.items():
|
for old, new in old_to_new.items():
|
||||||
old_parent = ifcopenshell.util.element.get_aggregate(old_element)
|
old_aggregate = ifcopenshell.util.element.get_aggregate(old)
|
||||||
if old_parent:
|
if old_aggregate:
|
||||||
new_parent = old_to_new[old_parent]
|
new_aggregate = old_to_new[old_aggregate]
|
||||||
blenderbim.core.aggregate.assign_object(
|
blenderbim.core.aggregate.assign_object(
|
||||||
tool.Ifc,
|
tool.Ifc,
|
||||||
tool.Aggregate,
|
tool.Aggregate,
|
||||||
tool.Collector,
|
tool.Collector,
|
||||||
relating_obj=tool.Ifc.get_object(new_parent[0]),
|
relating_obj=tool.Ifc.get_object(new_aggregate[0]),
|
||||||
related_obj=tool.Ifc.get_object(new_element[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():
|
||||||
|
|||||||
Reference in New Issue
Block a user