Walk the hierarchy from element up to IfcProject.
(element: ifcopenshell.entity_instance)
| 43 | |
| 44 | |
| 45 | def _traverse_up(element: ifcopenshell.entity_instance) -> list[dict[str, Any]]: |
| 46 | """Walk the hierarchy from element up to IfcProject.""" |
| 47 | chain = [_ref(element)] |
| 48 | current = element |
| 49 | while True: |
| 50 | parent = ifcopenshell.util.element.get_parent(current) |
| 51 | if parent is None: |
| 52 | break |
| 53 | chain.append(_ref(parent)) |
| 54 | current = parent |
| 55 | return chain |
| 56 | |
| 57 | |
| 58 | def _all_relations(model: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]: |
no test coverage detected