ifc2sql - skip creating geometry if iterator failed to initialize

This commit is contained in:
Andrej730
2025-07-03 18:10:43 +05:00
parent 0e8fb44301
commit 28043a8e5d
+5
View File
@@ -274,6 +274,11 @@ class Patcher(ifcpatch.BasePatcher):
products = self.elements
iterator = ifcopenshell.geom.iterator(self.settings, self.file, multiprocessing.cpu_count(), include=products)
valid_file = iterator.initialize()
if not valid_file:
# If there were no elements, iterator will also fail and it's okay not to report it.
if products:
print("WARNING. Geometry iterator failed to initialize.")
return
checkpoint = time.time()
progress = 0
total = len(products)