mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-05 20:06:25 +00:00
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:
@@ -20,9 +20,10 @@ class Selector:
|
|||||||
filter_value: ESCAPED_STRING
|
filter_value: ESCAPED_STRING
|
||||||
pset_or_qto: /[A-Za-z0-9_]+/ "." /[A-Za-z0-9_]+/
|
pset_or_qto: /[A-Za-z0-9_]+/ "." /[A-Za-z0-9_]+/
|
||||||
lfunction: and | or
|
lfunction: and | or
|
||||||
inverse_relationship: types | contains_elements
|
inverse_relationship: types | contains_elements | boundedby
|
||||||
types: "*"
|
types: "*"
|
||||||
contains_elements: "@"
|
contains_elements: "@"
|
||||||
|
boundedby: "@@"
|
||||||
and: "&"
|
and: "&"
|
||||||
or: "|"
|
or: "|"
|
||||||
comparison: contains | morethanequalto | lessthanequalto | equal | morethan | lessthan
|
comparison: contains | morethanequalto | lessthanequalto | equal | morethan | lessthan
|
||||||
@@ -116,6 +117,9 @@ class Selector:
|
|||||||
elif inverse_relationship == "contains_elements" and hasattr(element, "ContainsElements"):
|
elif inverse_relationship == "contains_elements" and hasattr(element, "ContainsElements"):
|
||||||
for relationship in element.ContainsElements:
|
for relationship in element.ContainsElements:
|
||||||
results.extend(relationship.RelatedElements)
|
results.extend(relationship.RelatedElements)
|
||||||
|
elif inverse_relationship == "boundedby" and hasattr(element, "BoundedBy"):
|
||||||
|
for relationship in element.BoundedBy:
|
||||||
|
results.append(relationship.RelatedBuildingElement)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def get_class_selector(self, class_selector):
|
def get_class_selector(self, class_selector):
|
||||||
|
|||||||
Reference in New Issue
Block a user