mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Optimisation for not iterating through things with no representations
Iterator initialise can take a few seconds on large models even though you're just doing a few elements which have no representations.
This commit is contained in:
@@ -723,6 +723,11 @@ class IfcImporter:
|
||||
results = set()
|
||||
if not products:
|
||||
return results
|
||||
|
||||
# For efficiency (iterator.initialize takes time), return early if there are no representations
|
||||
if not any(product.Representation for product in products):
|
||||
return results
|
||||
|
||||
if tool.Loader.settings.should_use_cpu_multiprocessing:
|
||||
iterator = ifcopenshell.geom.iterator(
|
||||
settings,
|
||||
|
||||
Reference in New Issue
Block a user