From e5dd06c46151d338955bb143c37ffb45763a1fb2 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 19 Mar 2024 12:29:02 +0500 Subject: [PATCH] Fix for loading IFC files with non-IfcElement based IfcRelNests Example is below, it was using IfcAlignment to aggregate IfcAnnotations and IfcReferents. I've added support loading collections for IfcPositioningElements besides IfcGrid (grids already handled separately). https://community.osarch.org/discussion/2034/ifc-not-visible-after-loaded-in-blender-bim --- src/blenderbim/blenderbim/bim/import_ifc.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 7db325ecdb..c7d0ee14b9 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -1622,7 +1622,11 @@ class IfcImporter: ] + [ r for r in self.file.by_type("IfcRelNests") - if (r.RelatingObject.is_a("IfcElement") or r.RelatingObject.is_a("IfcElementType")) + if ( + r.RelatingObject.is_a("IfcElement") + or r.RelatingObject.is_a("IfcElementType") + or (r.RelatingObject.is_a("IfcPositioningElement") and not r.RelatingObject.is_a("IfcGrid")) + ) and [e for e in r.RelatedObjects if not e.is_a("IfcPort")] ] @@ -1733,8 +1737,8 @@ class IfcImporter: elif getattr(element, "Nests", None) and not element.is_a("IfcPort"): nest = ifcopenshell.util.element.get_nest(element) return self.collections[nest.GlobalId].objects.link(obj) - else: - return self.place_object_in_spatial_decomposition_collection(element, obj) + + return self.place_object_in_spatial_decomposition_collection(element, obj) def place_object_in_spatial_decomposition_collection( self, element: ifcopenshell.entity_instance, obj: bpy.types.Object