mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-29 11:46:33 +00:00
Fix bug where attributes wouldn't import for some IFC classes
This commit is contained in:
@@ -1782,11 +1782,9 @@ class IfcImporter():
|
|||||||
|
|
||||||
def add_element_attributes(self, element, obj):
|
def add_element_attributes(self, element, obj):
|
||||||
attributes = element.get_info()
|
attributes = element.get_info()
|
||||||
if element.is_a() in schema.ifc.elements:
|
|
||||||
applicable_attributes = [a['name'] for a in schema.ifc.elements[element.is_a()]['attributes']]
|
|
||||||
for key, value in attributes.items():
|
for key, value in attributes.items():
|
||||||
if key not in applicable_attributes \
|
if value is None or isinstance(value, ifcopenshell.entity_instance) \
|
||||||
or value is None:
|
or key == 'id' or key == 'type':
|
||||||
continue
|
continue
|
||||||
attribute = obj.BIMObjectProperties.attributes.add()
|
attribute = obj.BIMObjectProperties.attributes.add()
|
||||||
attribute.name = key
|
attribute.name = key
|
||||||
|
|||||||
Reference in New Issue
Block a user