Fix #1528. Fix bug where IFC project libraries could not be imported as a file.

This commit is contained in:
Dion Moult
2021-08-07 21:06:23 +10:00
parent 0087fa875b
commit 5a52f3aeea
2 changed files with 14 additions and 6 deletions
@@ -23,10 +23,10 @@ class Data:
product = cls.file.by_id(product_id)
cls.types[product_id] = None
if cls.file.schema == "IFC2X3":
if hasattr(product, "ObjectTypeOf"):
if getattr(product, "ObjectTypeOf", None):
cls.types[product_id] = [o.id() for o in product.ObjectTypeOf[0].RelatedObjects]
else:
if hasattr(product, "Types"):
if getattr(product, "Types", None):
cls.types[product_id] = [o.id() for o in product.Types[0].RelatedObjects]
@classmethod