mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
See #6030. You can now select elements in groups recursively.
This commit is contained in:
@@ -1000,7 +1000,9 @@ def get_decomposition(element: ifcopenshell.entity_instance, is_recursive=True)
|
||||
return results
|
||||
|
||||
|
||||
def get_grouped_by(element: ifcopenshell.entity_instance) -> list[ifcopenshell.entity_instance]:
|
||||
def get_grouped_by(
|
||||
element: ifcopenshell.entity_instance, is_recursive: bool = True
|
||||
) -> list[ifcopenshell.entity_instance]:
|
||||
"""Retrieves all subelements of an element based on the group.
|
||||
|
||||
:param element: IfcGroup entity
|
||||
@@ -1021,6 +1023,8 @@ def get_grouped_by(element: ifcopenshell.entity_instance) -> list[ifcopenshell.e
|
||||
related_objects = rel.RelatedObjects
|
||||
queue.extend(related_objects)
|
||||
results.extend(related_objects)
|
||||
if not is_recursive:
|
||||
break
|
||||
return results
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user