Skip to content

Commit 1365b76

Browse files
committed
Lazily check for BBIM_Railing psets to prevent unnecessarily fetching psets for every element when loading models.
1 parent 47cc315 commit 1365b76

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/blenderbim/blenderbim/bim/import_ifc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,19 +410,19 @@ def is_native(self, element):
410410
return True
411411

412412
def is_native_swept_disk_solid(self, element, representations):
413-
# detect BBIM Railings to represent them with meshes and not curves
414-
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
415-
return False
416-
417413
for representation in representations:
418414
items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :(
419415
if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):
416+
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
417+
return False
420418
return True
421419
elif len(items) and ( # See #2508 why we accommodate for invalid IFCs here
422420
items[0].is_a("IfcSweptDiskSolid")
423421
and len({i.is_a() for i in items}) == 1
424422
and len({i.Radius for i in items}) == 1
425423
):
424+
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
425+
return False
426426
return True
427427
return False
428428

0 commit comments

Comments
 (0)