ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / CubicBezierBuilderEx Class / CreateCubicBezierSegment Method / CreateCubicBezierSegment(IEnumerable<MapPoint>,SpatialReference) Method
The enumeration of points from which the curve will be constructed. Four points must be supplied.
(Optional) The spatial reference. The default value is null. The spatial references of the input points are ignored.
Example

In This Topic
    CreateCubicBezierSegment(IEnumerable<MapPoint>,SpatialReference) Method
    In This Topic
    Convenience method to create a new instance of the CubicBezierSegment class from four control points.
    Syntax
    Public Overloads Shared Function CreateCubicBezierSegment( _
       ByVal points As IEnumerable(Of MapPoint), _
       Optional ByVal spatialReference As SpatialReference _
    ) As CubicBezierSegment

    Parameters

    points
    The enumeration of points from which the curve will be constructed. Four points must be supplied.
    spatialReference
    (Optional) The spatial reference. The default value is null. The spatial references of the input points are ignored.
    Exceptions
    ExceptionDescription
    Four points are required for a cubic bezier.
    points is null or one of the 4 points is null or empty.
    Remarks
    The four points of the cubic bezier segment. points[0] is the start point, points[1] and points[2] are the control points, and points[3] is the end point.
    Example
    Construct a Cubic Bezier - from an enumeration of MapPoints
    // Use a buildeExr convenience method or use a builderEx constructor.
    
    MapPoint startPt = MapPointBuilderEx.CreateMapPoint(1.0, 1.0, SpatialReferences.WGS84);
    MapPoint endPt = MapPointBuilderEx.CreateMapPoint(2.0, 2.0, SpatialReferences.WGS84);
    
    MapPoint ctrl1Pt = MapPointBuilderEx.CreateMapPoint(1.0, 2.0, SpatialReferences.WGS84);
    MapPoint ctrl2Pt = MapPointBuilderEx.CreateMapPoint(2.0, 1.0, SpatialReferences.WGS84);
    
    List<MapPoint> listMapPoints = new List<MapPoint>();
    listMapPoints.Add(startPt);
    listMapPoints.Add(ctrl1Pt);
    listMapPoints.Add(ctrl2Pt);
    listMapPoints.Add(endPt);
    
    // BuilderEx convenience methods don't need to run on the MCT
    CubicBezierSegment bezier = CubicBezierBuilderEx.CreateCubicBezierSegment(listMapPoints);
    
    // builderEx constructors dont need to run on the MCT
    CubicBezierBuilderEx cbbEx = new CubicBezierBuilderEx(listMapPoints);
    bezier = cbbEx.ToSegment() as CubicBezierSegment;
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also