mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 22:31:55 +00:00
info message for refresh_aggregate
This commit is contained in:
@@ -1180,22 +1180,26 @@ class RefreshAggregate(bpy.types.Operator):
|
|||||||
return new_entity
|
return new_entity
|
||||||
|
|
||||||
if len(context.selected_objects) != 1:
|
if len(context.selected_objects) != 1:
|
||||||
|
self.report({"INFO"}, "Only 1 object need to be selected.")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
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 not selected_root_entity.is_a("IfcElementAssembly"):
|
||||||
|
self.report({"INFO"}, "Object is not 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.")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
pset_data = json.loads(pset["Data"])[0]
|
pset_data = json.loads(pset["Data"])[0]
|
||||||
instance_of = pset_data["instance_of"][0]
|
instance_of = pset_data["instance_of"][0]
|
||||||
original_root_entity = tool.Ifc.get().by_guid(instance_of)
|
original_root_entity = tool.Ifc.get().by_guid(instance_of)
|
||||||
if original_root_entity == selected_root_entity:
|
if original_root_entity == selected_root_entity:
|
||||||
|
self.report({"INFO"}, "Cannot refresh original assembly. Select an assembly instance.")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
parents = remove_objects(selected_root_entity)
|
parents = remove_objects(selected_root_entity)
|
||||||
|
|||||||
Reference in New Issue
Block a user