From f7b2a68ed317dfce289aeef8b01eff1de50eddfd Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 19 May 2023 17:28:58 +0500 Subject: [PATCH] Detect BBIM railings at import to import as meshes not curves #3144 Sometimes railing could consist just of one IFCSWEPTDISKSOLID then it will be considered native swept disk solid and imported as a curve. But when user create BBIM railing they edit it as a mesh and curve might look a bit different. Therefore we detect it now at import to make sure it's going to be reprsented the same way as it was saved. --- src/blenderbim/blenderbim/bim/import_ifc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/import_ifc.py b/src/blenderbim/blenderbim/bim/import_ifc.py index 77f75dc17b..1399f001a0 100644 --- a/src/blenderbim/blenderbim/bim/import_ifc.py +++ b/src/blenderbim/blenderbim/bim/import_ifc.py @@ -381,7 +381,7 @@ class IfcImporter: representations = self.get_transformed_body_representations(element.Representation.Representations) # Single swept disk solids (e.g. rebar) are better natively represented as beveled curves - if self.is_native_swept_disk_solid(representations): + if self.is_native_swept_disk_solid(element, representations): self.native_data[element.GlobalId] = { "representations": representations, "representation": self.get_body_representation(element.Representation.Representations), @@ -409,7 +409,11 @@ class IfcImporter: } return True - def is_native_swept_disk_solid(self, representations): + def is_native_swept_disk_solid(self, element, representations): + # detect BBIM Railings to represent them with meshes and not curves + if tool.Pset.get_element_pset(element, "BBIM_Railing"): + return False + for representation in representations: items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :( if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):