mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
bim.load_profiles - try not to check all inverses for optimization
This commit is contained in:
@@ -44,7 +44,9 @@ class LoadProfiles(bpy.types.Operator):
|
|||||||
for profile in tool.Ifc.get().by_type("IfcProfileDef"):
|
for profile in tool.Ifc.get().by_type("IfcProfileDef"):
|
||||||
if filter_material_profiles:
|
if filter_material_profiles:
|
||||||
inverse_references = tool.Ifc.get().get_inverse(profile)
|
inverse_references = tool.Ifc.get().get_inverse(profile)
|
||||||
related_material_profiles = [ref for ref in inverse_references if ref.is_a("IfcMaterialProfile")]
|
related_material_profiles = next(
|
||||||
|
(ref for ref in inverse_references if ref.is_a("IfcMaterialProfile")), None
|
||||||
|
)
|
||||||
if not related_material_profiles:
|
if not related_material_profiles:
|
||||||
continue
|
continue
|
||||||
if not profile.ProfileName:
|
if not profile.ProfileName:
|
||||||
|
|||||||
Reference in New Issue
Block a user