From 83bd0a973c4e1b95e5c80e209a62483a39fdbae2 Mon Sep 17 00:00:00 2001 From: Boris Brangeon Date: Wed, 19 Oct 2022 09:49:06 +0200 Subject: [PATCH] Add function grouped_by in Selector (#2515) --- src/ifcopenshell-python/ifcopenshell/util/selector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/selector.py b/src/ifcopenshell-python/ifcopenshell/util/selector.py index a1adeedf6c..4c6837cc5c 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/selector.py +++ b/src/ifcopenshell-python/ifcopenshell/util/selector.py @@ -39,10 +39,11 @@ class Selector: filter_value: ESCAPED_STRING | SIGNED_FLOAT | SIGNED_INT | BOOLEAN | NULL pset_or_qto: /[^\\W][^.=<>]*[^\\W]/ "." /[^\\W][^.=<>]*[^\\W]/ lfunction: and | or - inverse_relationship: types | decomposed_by | bounded_by + inverse_relationship: types | decomposed_by | bounded_by | grouped_by types: "*" decomposed_by: "@" bounded_by: "@@" + grouped_by: "@@@" and: "&" or: "|" not: "!" @@ -143,6 +144,8 @@ class Selector: results.extend(element.ObjectTypeOf[0].RelatedObjects) elif inverse_relationship == "decomposed_by": results.extend(ifcopenshell.util.element.get_decomposition(element)) + elif inverse_relationship == "grouped_by": + results.extend(ifcopenshell.util.element.get_grouped_by(element)) elif inverse_relationship == "bounded_by" and hasattr(element, "BoundedBy"): for relationship in element.BoundedBy: results.append(relationship.RelatedBuildingElement)