Skip to content

Commit

Permalink
Fix #4655. profiles is now available as a keyword in the selector s…
Browse files Browse the repository at this point in the history
…yntax.
  • Loading branch information
Moult committed May 11, 2024
1 parent 55026ca commit b7737cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Valid keys are:
"``material`` or ``mat``", "Gets the assigned material, which may be a material set."
"``item`` or ``i``", "If the previous key returns a material set, gets the relevant material set items"
"``materials`` or ``mats``", "Gets a list of IfcMaterials assigned directly or indirectly (such as via a material set) to the element"
"``profiles``", "Gets a list of IfcProfileDefs assigned (such as via a material profile) or used (such as in an extrusion) in the element"
"``x``", "Gets the X coordinate of the element's placement"
"``y``", "Gets the Y coordinate of the element's placement"
"``z``", "Gets the Z coordinate of the element's placement"
Expand Down
2 changes: 2 additions & 0 deletions src/ifcopenshell-python/ifcopenshell/util/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,8 @@ def get_element_value(cls, element: ifcopenshell.entity_instance, keys: list[str
value = ifcopenshell.util.element.get_material(value, should_skip_usage=True)
elif key in ("materials", "mats"):
value = ifcopenshell.util.element.get_materials(value)
elif key == "profiles":
value = ifcopenshell.util.shape.get_profiles(value)
elif key == "styles":
value = ifcopenshell.util.element.get_styles(value)
elif key in ("item", "i"):
Expand Down

0 comments on commit b7737cb

Please sign in to comment.