Update selector.py (#1627)

Add new inverse_relationship ==> boundedby

If Entity IfcRelSpaceBoundary exist then hasattr(element, "BoundedBy") is True and relationship.RelatedBuildingElement exist.

New Rule Lark :  "@@ .IfcSpace[Name *= \"Bedroom\"] & .IfcSlab"
This commit is contained in:
Boris Brangeon
2021-08-04 11:55:51 +02:00
committed by GitHub
parent 562b520233
commit d71e89f823
@@ -20,9 +20,10 @@ class Selector:
filter_value: ESCAPED_STRING
pset_or_qto: /[A-Za-z0-9_]+/ "." /[A-Za-z0-9_]+/
lfunction: and | or
inverse_relationship: types | contains_elements
inverse_relationship: types | contains_elements | boundedby
types: "*"
contains_elements: "@"
boundedby: "@@"
and: "&"
or: "|"
comparison: contains | morethanequalto | lessthanequalto | equal | morethan | lessthan
@@ -116,6 +117,9 @@ class Selector:
elif inverse_relationship == "contains_elements" and hasattr(element, "ContainsElements"):
for relationship in element.ContainsElements:
results.extend(relationship.RelatedElements)
elif inverse_relationship == "boundedby" and hasattr(element, "BoundedBy"):
for relationship in element.BoundedBy:
results.append(relationship.RelatedBuildingElement)
return results
def get_class_selector(self, class_selector):