Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit b7737cb

Browse files
committed
Fix IfcOpenShell#4655. profiles is now available as a keyword in the selector syntax.
1 parent 55026ca commit b7737cb

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

src/ifcopenshell-python/docs/ifcopenshell-python/selector_syntax.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ Valid keys are:
186186
"``material`` or ``mat``", "Gets the assigned material, which may be a material set."
187187
"``item`` or ``i``", "If the previous key returns a material set, gets the relevant material set items"
188188
"``materials`` or ``mats``", "Gets a list of IfcMaterials assigned directly or indirectly (such as via a material set) to the element"
189+
"``profiles``", "Gets a list of IfcProfileDefs assigned (such as via a material profile) or used (such as in an extrusion) in the element"
189190
"``x``", "Gets the X coordinate of the element's placement"
190191
"``y``", "Gets the Y coordinate of the element's placement"
191192
"``z``", "Gets the Z coordinate of the element's placement"

src/ifcopenshell-python/ifcopenshell/util/selector.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,8 @@ def get_element_value(cls, element: ifcopenshell.entity_instance, keys: list[str
970970
value = ifcopenshell.util.element.get_material(value, should_skip_usage=True)
971971
elif key in ("materials", "mats"):
972972
value = ifcopenshell.util.element.get_materials(value)
973+
elif key == "profiles":
974+
value = ifcopenshell.util.shape.get_profiles(value)
973975
elif key == "styles":
974976
value = ifcopenshell.util.element.get_styles(value)
975977
elif key in ("item", "i"):

0 commit comments

Comments
 (0)