From 9ec80cee0d3a18c44e4c87d61b8217424a4efa4e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 21 Mar 2024 15:02:15 +0500 Subject: [PATCH] TesselateElements - avoid processing queries that affect no elements Previously it was failing with File "\ifcopenshell\geom\main.py", line 119, in __init__ self.this = initializer( File "\ifcopenshell\ifcopenshell_wrapper.py", line 2467, in construct_iterator_with_include_exclude return _ifcopenshell_wrapper.construct_iterator_with_include_exclude(settings, file, elems, include, num_threads) TypeError: Attribute of type AGGREGATE OF STRING needs a python sequence of strs --- src/ifcpatch/ifcpatch/recipes/TessellateElements.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py index 88635144a3..e16f4c600f 100644 --- a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py +++ b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py @@ -66,6 +66,10 @@ class Patcher: def patch(self): context = ifcopenshell.util.representation.get_context(self.file, "Model", "Body", "MODEL_VIEW") elements = ifcopenshell.util.selector.filter_elements(self.file, self.query) + + if not elements: + return + settings = ifcopenshell.geom.settings() settings.set(settings.STRICT_TOLERANCE, True) settings.set_context_ids([context.id()])