bim.add_array - guard from unexpected element types

So we can gradually expand it with the things we do know to support.
This commit is contained in:
Andrej730
2025-04-29 17:32:27 +05:00
parent dc46afc227
commit 0b8fb41ac4
@@ -38,6 +38,13 @@ class AddArray(bpy.types.Operator, tool.Ifc.Operator):
assert (element := tool.Ifc.get_entity(obj))
ifc_file = tool.Ifc.get()
if not element.is_a("IfcElement") and not element.is_a("IfcAnnotation"):
self.report(
{"ERROR"},
f"Adding array to element of type '{element.is_a()}' is not supported. Supported types: IfcElement, IfcAnnotation.",
)
return {"CANCELLED"}
array = {
"children": [],
"count": 1,