mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Refresh aggregate from selecting a part
This commit is contained in:
@@ -1186,10 +1186,17 @@ class RefreshAggregate(bpy.types.Operator):
|
|||||||
selected_root_obj = context.selected_objects[0]
|
selected_root_obj = context.selected_objects[0]
|
||||||
selected_root_entity = tool.Ifc.get_entity(selected_root_obj)
|
selected_root_entity = tool.Ifc.get_entity(selected_root_obj)
|
||||||
|
|
||||||
if not selected_root_entity.is_a("IfcElementAssembly"):
|
if selected_root_entity.is_a("IfcElementAssembly"):
|
||||||
self.report({"INFO"}, "Object is not IfcElementAssembly.")
|
return
|
||||||
|
elif selected_root_entity.Decomposes:
|
||||||
|
if selected_root_entity.Decomposes[0].RelatingObject.is_a("IfcElementAssembly"):
|
||||||
|
selected_root_entity = selected_root_entity.Decomposes[0].RelatingObject
|
||||||
|
selected_root_obj = tool.Ifc.get_object(selected_root_entity)
|
||||||
|
else:
|
||||||
|
self.report({"INFO"}, "Object is not part of a IfcElementAssembly.")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
pset = ifcopenshell.util.element.get_pset(selected_root_entity, "BBIM_Aggregate_Data")
|
pset = ifcopenshell.util.element.get_pset(selected_root_entity, "BBIM_Aggregate_Data")
|
||||||
if not pset:
|
if not pset:
|
||||||
self.report({"INFO"}, "Object is not part of an assembly aggregate.")
|
self.report({"INFO"}, "Object is not part of an assembly aggregate.")
|
||||||
|
|||||||
Reference in New Issue
Block a user