mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Refactor get alignment layouts into util
This commit is contained in:
@@ -19,20 +19,12 @@
|
||||
from collections.abc import Sequence
|
||||
|
||||
from ifcopenshell import entity_instance
|
||||
import ifcopenshell.util.alignment
|
||||
|
||||
|
||||
# TODO remove this function, use util directly
|
||||
def get_alignment_layouts(alignment: entity_instance) -> Sequence[entity_instance]:
|
||||
"""
|
||||
Returns the layout alignments nested to this alignment
|
||||
"""
|
||||
layouts = []
|
||||
for rel in alignment.IsNestedBy:
|
||||
for layout in rel.RelatedObjects:
|
||||
if (
|
||||
layout.is_a("IfcAlignmentHorizontal")
|
||||
or layout.is_a("IfcAlignmentVertical")
|
||||
or layout.is_a("IfcAlignmentCant")
|
||||
):
|
||||
layouts.append(layout)
|
||||
|
||||
return layouts
|
||||
return ifcopenshell.util.alignment.get_alignment_layouts(alignment)
|
||||
|
||||
Reference in New Issue
Block a user