mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Don't fail on unmapped attribute types (IFC4.4)
This commit is contained in:
@@ -40,6 +40,10 @@ except ImportError as e:
|
|||||||
def set_derived_attribute(*args):
|
def set_derived_attribute(*args):
|
||||||
raise TypeError("Unable to set derived attribute")
|
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
|
# For every schema and its entities populate a list
|
||||||
# of functions for every entity attribute (including
|
# of functions for every entity attribute (including
|
||||||
@@ -79,6 +83,9 @@ def register_schema_attributes(schema):
|
|||||||
functions = [
|
functions = [
|
||||||
set_derived_attribute
|
set_derived_attribute
|
||||||
if mname == "setArgumentAsDerived"
|
if mname == "setArgumentAsDerived"
|
||||||
|
else
|
||||||
|
set_unsupported_attribute
|
||||||
|
if mname == "setArgumentAsUnknown"
|
||||||
else getattr(ifcopenshell_wrapper.entity_instance, mname)
|
else getattr(ifcopenshell_wrapper.entity_instance, mname)
|
||||||
for mname in fn_names
|
for mname in fn_names
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user