Fix import bug getting geometry type of objects without a representation

E.g. an IfcGridAxis
This commit is contained in:
Dion Moult
2020-07-31 15:41:06 +10:00
parent e63f083a40
commit e9cd48c62d
@@ -1778,10 +1778,10 @@ class IfcImporter():
return representation.Items[0].MappingTarget
def get_geometry_type(self, element):
tree = []
if hasattr(element, 'Representation'):
tree = self.file.traverse(element.Representation)
elif hasattr(element, 'RepresentationMaps'):
tree = []
for representation_map in element.RepresentationMaps:
tree.extend(self.file.traverse(representation_map))
representations = [e for e in tree if e.is_a('IfcRepresentation') \