diff --git a/src/ifcopenshell-python/ifcopenshell/api/alignment/__init__.py b/src/ifcopenshell-python/ifcopenshell/api/alignment/__init__.py index 56a158842c..e0d5684164 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/alignment/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/api/alignment/__init__.py @@ -25,7 +25,7 @@ are automatically created and maintained. Alignments are created with stationing referents. Each layout segment is assigned a position referent that informs about the start point of the segment. An example is the point of curvature of a horizontal circular curve. The referent is -nested to the segment representing the circular arc and is named with a indicator of the position and the station, e.g. "P.C. (145+98.32)" +nested to the segment representing the circular arc and is named with the alignment name and an indicator of the position and the station, e.g. "MyAlignment 145+98.32 (P.C.)" This API does not determine alignment parameters based on rules, such as minimum curve radius as a function of design speed or sight distance. @@ -89,6 +89,7 @@ from .layout_vertical_alignment_by_pi_method import ( layout_vertical_alignment_by_pi_method, ) from .name_segments import name_segments +from .update_alignment_parameter_segment_tags import update_alignment_parameter_segment_tags from .update_end_point import update_end_point from .update_fallback_position import update_fallback_position from .update_key_point_referents import update_key_point_referents @@ -132,6 +133,7 @@ __all__ = [ "layout_vertical_alignment_by_pi_method", "name_segments", "register_referent_name_callback", + "update_alignment_parameter_segment_tags", "update_end_point", "update_fallback_position", "update_key_point_referents", diff --git a/src/ifcopenshell-python/ifcopenshell/api/alignment/_get_key_point_tag.py b/src/ifcopenshell-python/ifcopenshell/api/alignment/_get_key_point_tag.py new file mode 100644 index 0000000000..ca888f2e9c --- /dev/null +++ b/src/ifcopenshell-python/ifcopenshell/api/alignment/_get_key_point_tag.py @@ -0,0 +1,30 @@ +# IfcOpenShell - IFC toolkit and geometry engine +# Copyright (C) 2025 Thomas Krijnen +# +# This file is part of IfcOpenShell. +# +# IfcOpenShell is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# IfcOpenShell is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with IfcOpenShell. If not, see . + +import ifcopenshell +import ifcopenshell.util.alignment + + +def _get_key_point_tag(file: ifcopenshell.file, label: str, station: float) -> str: + """ + Builds the station-and-label text shared by update_alignment_parameter_segment_tags (used + directly as IfcAlignmentParameterSegment.StartTag/EndTag) and update_key_point_referents (used, + prefixed with the alignment name, as IfcReferent.Name): " (