mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 16:22:53 +00:00
Lazily check for BBIM_Railing psets to prevent unnecessarily fetching psets for every element when loading models.
This commit is contained in:
@@ -410,19 +410,19 @@ class IfcImporter:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def is_native_swept_disk_solid(self, element, 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:
|
for representation in representations:
|
||||||
items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :(
|
items = representation["raw"].Items or [] # Be forgiving of invalid IFCs because Revit :(
|
||||||
if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):
|
if len(items) == 1 and items[0].is_a("IfcSweptDiskSolid"):
|
||||||
|
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
elif len(items) and ( # See #2508 why we accommodate for invalid IFCs here
|
elif len(items) and ( # See #2508 why we accommodate for invalid IFCs here
|
||||||
items[0].is_a("IfcSweptDiskSolid")
|
items[0].is_a("IfcSweptDiskSolid")
|
||||||
and len({i.is_a() for i in items}) == 1
|
and len({i.is_a() for i in items}) == 1
|
||||||
and len({i.Radius for i in items}) == 1
|
and len({i.Radius for i in items}) == 1
|
||||||
):
|
):
|
||||||
|
if tool.Pset.get_element_pset(element, "BBIM_Railing"):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user