mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
Add function grouped_by in Selector (#2515)
This commit is contained in:
@@ -39,10 +39,11 @@ class Selector:
|
|||||||
filter_value: ESCAPED_STRING | SIGNED_FLOAT | SIGNED_INT | BOOLEAN | NULL
|
filter_value: ESCAPED_STRING | SIGNED_FLOAT | SIGNED_INT | BOOLEAN | NULL
|
||||||
pset_or_qto: /[^\\W][^.=<>]*[^\\W]/ "." /[^\\W][^.=<>]*[^\\W]/
|
pset_or_qto: /[^\\W][^.=<>]*[^\\W]/ "." /[^\\W][^.=<>]*[^\\W]/
|
||||||
lfunction: and | or
|
lfunction: and | or
|
||||||
inverse_relationship: types | decomposed_by | bounded_by
|
inverse_relationship: types | decomposed_by | bounded_by | grouped_by
|
||||||
types: "*"
|
types: "*"
|
||||||
decomposed_by: "@"
|
decomposed_by: "@"
|
||||||
bounded_by: "@@"
|
bounded_by: "@@"
|
||||||
|
grouped_by: "@@@"
|
||||||
and: "&"
|
and: "&"
|
||||||
or: "|"
|
or: "|"
|
||||||
not: "!"
|
not: "!"
|
||||||
@@ -143,6 +144,8 @@ class Selector:
|
|||||||
results.extend(element.ObjectTypeOf[0].RelatedObjects)
|
results.extend(element.ObjectTypeOf[0].RelatedObjects)
|
||||||
elif inverse_relationship == "decomposed_by":
|
elif inverse_relationship == "decomposed_by":
|
||||||
results.extend(ifcopenshell.util.element.get_decomposition(element))
|
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"):
|
elif inverse_relationship == "bounded_by" and hasattr(element, "BoundedBy"):
|
||||||
for relationship in element.BoundedBy:
|
for relationship in element.BoundedBy:
|
||||||
results.append(relationship.RelatedBuildingElement)
|
results.append(relationship.RelatedBuildingElement)
|
||||||
|
|||||||
Reference in New Issue
Block a user