Don't fail on unmapped attribute types (IFC4.4)

This commit is contained in:
Thomas Krijnen
2023-04-10 20:17:26 +02:00
committed by GitHub
parent e71ee988bf
commit cc49b0efdc
@@ -40,6 +40,10 @@ except ImportError as e:
def set_derived_attribute(*args):
raise TypeError("Unable to set derived attribute")
def set_unsupported_attribute(*args):
raise TypeError("This is an unsupported attribute type")
# For every schema and its entities populate a list
# of functions for every entity attribute (including
@@ -79,6 +83,9 @@ def register_schema_attributes(schema):
functions = [
set_derived_attribute
if mname == "setArgumentAsDerived"
else
set_unsupported_attribute
if mname == "setArgumentAsUnknown"
else getattr(ifcopenshell_wrapper.entity_instance, mname)
for mname in fn_names
]