feat: Add alignment representation templates to AddElement dialog

Wire IfcAlignment creation into Bonsai's Add IFC Element flow with
representation template options (Horizontal, Gradient, Cant, 3D/2D
Polyline). Adds create_representation_structure() to tool.Alignment
which creates layout containers, geometric representation, and
polyline placeholders. Guards create_representation against empty
layout nests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
DesertSpringsCivil
2026-03-03 23:53:41 -07:00
parent 0b3967609c
commit e09ce1bcd8
4 changed files with 122 additions and 4 deletions
@@ -52,5 +52,6 @@ def create_representation(
for layout in layouts:
curve = ifcopenshell.api.alignment.get_layout_curve(layout)
layout_nest = ifcopenshell.api.alignment.get_alignment_segment_nest(layout)
for segment in layout_nest.RelatedObjects:
_add_segment_to_curve(file, segment, curve)
if layout_nest: # None when no segments exist yet (by design of get_alignment_segment_nest)
for segment in layout_nest.RelatedObjects:
_add_segment_to_curve(file, segment, curve)