From 7c0f5ca7bcc47de2858637dfc451490f4b64e68a Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 11 Jan 2020 07:51:57 +1100 Subject: [PATCH] Allow import of site objects --- src/ifcblenderexport/blenderbim/import_ifc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ifcblenderexport/blenderbim/import_ifc.py b/src/ifcblenderexport/blenderbim/import_ifc.py index 8b92be0f16..fc974b75b7 100644 --- a/src/ifcblenderexport/blenderbim/import_ifc.py +++ b/src/ifcblenderexport/blenderbim/import_ifc.py @@ -393,7 +393,10 @@ class IfcImporter(): self.spatial_structure_elements[structure_name]['blender'].objects.link(obj) elif hasattr(element, 'Decomposes') \ and element.Decomposes: - collection = bpy.data.collections.get(f'IfcRelAggregates/{element.Decomposes[0].id()}') + if element.Decomposes[0].RelatingObject.is_a('IfcProject'): + collection = bpy.data.collections.get(f'IfcProject/{element.Decomposes[0].RelatingObject.Name}') + else: + collection = bpy.data.collections.get(f'IfcRelAggregates/{element.Decomposes[0].id()}') if collection: collection.objects.link(obj) elif hasattr(element, 'HasFillings') \