mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
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:
@@ -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()])
|
||||
|
||||
Reference in New Issue
Block a user