bim.show_loads - handle absence of structural items

This commit is contained in:
Andrej730
2025-03-14 14:54:43 +05:00
parent 2f87029434
commit f36830d6dc
@@ -52,7 +52,11 @@ class ShowLoads(bpy.types.Operator):
return {"PASS_THROUGH"}
def invoke(self, context, event):
collection = bpy.data.collections["IfcStructuralItem"]
collection = bpy.data.collections.get("IfcStructuralItem")
if collection is None:
self.report({"ERROR"}, "No IfcStructuralItems found.")
return {"CANCELLED"}
collection.hide_viewport = False
context.window.cursor_modal_set("WAIT")
try: