From a54b21b838edd49636634e78ee44eb6430db86a7 Mon Sep 17 00:00:00 2001 From: Richard Brice <37087370+RickBrice@users.noreply.github.com> Date: Thu, 5 Feb 2026 04:37:58 -0800 Subject: [PATCH] Fixes documentation and adds test for expected type --- .../api/alignment/_create_offset_curve_representation.py | 7 ++++++- .../ifcopenshell/api/alignment/create_as_offset_curve.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/alignment/_create_offset_curve_representation.py b/src/ifcopenshell-python/ifcopenshell/api/alignment/_create_offset_curve_representation.py index 6850013c96..bb3fa6cbe8 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/alignment/_create_offset_curve_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/alignment/_create_offset_curve_representation.py @@ -28,7 +28,7 @@ def _create_offset_curve_representation( file: ifcopenshell.file, alignment: entity_instance, offsets: Sequence[entity_instance] ) -> None: """ - Create geometric representation for the alignment based on an IfcPolyline + Create geometric representation for the alignment based on an IfcOffsetByDistances curve :param alignment: The alignment for which the representation is being created :return: None @@ -36,6 +36,11 @@ def _create_offset_curve_representation( expected_type = "IfcAlignment" if not alignment.is_a(expected_type): raise TypeError(f"Expected {expected_type} but got {alignment.is_a()}") + + expected_type = "IfcPointByDistaceExpression" + for offset in offsets: + if not offset.is_a(expected_type): + raise TypeError(f"Expected {expected_type} but got {offset.is_a()}") axis_geom_subcontext = ifcopenshell.api.alignment.get_axis_subcontext(file) diff --git a/src/ifcopenshell-python/ifcopenshell/api/alignment/create_as_offset_curve.py b/src/ifcopenshell-python/ifcopenshell/api/alignment/create_as_offset_curve.py index b24fb16b29..6ac56af362 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/alignment/create_as_offset_curve.py +++ b/src/ifcopenshell-python/ifcopenshell/api/alignment/create_as_offset_curve.py @@ -39,7 +39,7 @@ def create_as_offset_curve( :param file: :param name: name assigned to IfcAlignment.Name - :param offsets: offsets from the basis curve that defines the offset curve, expected to be IfcOffsetCurveByDistances. + :param offsets: offsets from the basis curve that defines the offset curve, expected to be IfcPointByDistanceExpression. :param start_station: station value at the start of the alignment :return: Returns an IfcAlignment """