mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 01:11:40 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user