Minor fix to IFCCSV when exporting non-existant attributes

This commit is contained in:
Dion Moult
2020-04-26 14:12:31 +10:00
parent 3d45f9afeb
commit a695eecd9a
+3 -2
View File
@@ -143,9 +143,10 @@ class IfcSelectorParser():
class IfcAttributeExtractor(): class IfcAttributeExtractor():
@staticmethod @staticmethod
def get_element_key(element, key): def get_element_key(element, key):
if '.' not in key \ if hasattr(element, key):
and hasattr(element, key):
return getattr(element, key) return getattr(element, key)
elif '.' not in key:
return None
elif key[0:3] == 'Qto': elif key[0:3] == 'Qto':
qto_name, prop = key.split('.') qto_name, prop = key.split('.')
qto = IfcAttributeExtractor.get_element_qto(element, qto_name) qto = IfcAttributeExtractor.get_element_qto(element, qto_name)