mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +00:00
ifcopenshell.util.selector.filter_elements - inherited predefined types
mentioned by @theoryshaw on osarch - https://community.osarch.org/discussion/comment/20126/#Comment_20126
This commit is contained in:
@@ -524,7 +524,10 @@ class FacetTransformer(lark.Transformer):
|
||||
name = name.children[0].value
|
||||
|
||||
def filter_function(element):
|
||||
element_value = getattr(element, name, None)
|
||||
if name == "PredefinedType":
|
||||
element_value = ifcopenshell.util.element.get_predefined_type(element)
|
||||
else:
|
||||
element_value = getattr(element, name, None)
|
||||
return self.compare(element_value, comparison, value)
|
||||
|
||||
self.elements = set(filter(filter_function, self.elements))
|
||||
|
||||
Reference in New Issue
Block a user