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
This commit is contained in:
Andrej730
2024-03-21 15:02:15 +05:00
parent a5daf4177a
commit 9ec80cee0d
@@ -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()])