ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / CubicBezierBuilderEx Class / CubicBezierBuilderEx Constructor / CubicBezierBuilderEx Constructor(IEnumerable<MapPoint>,SpatialReference)
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
    CubicBezierBuilderEx Constructor(IEnumerable<MapPoint>,SpatialReference)
    In This Topic
    Creates a new instance of the CubicBezierBuilderEx class from a set of points. Four points must be supplied.
    Syntax
    Public Function New( _
       ByVal points As IEnumerable(Of MapPoint), _
       Optional ByVal spatialReference As SpatialReference _
    )

    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 don't need to run on the MCT
      CubicBezierBuilderEx cbbEx = new CubicBezierBuilderEx(listMapPoints);
      bezier = cbbEx.ToSegment() as CubicBezierSegment;
    }
    Create Bezier Text Element
    {
      //Note: Must be on QueuedTask.Run
    
      //Build geometry
      Coordinate2D pt1 = new Coordinate2D(3.5, 7.5);
      Coordinate2D pt2 = new Coordinate2D(4.16, 8);
      Coordinate2D pt3 = new Coordinate2D(4.83, 7.1);
      Coordinate2D pt4 = new Coordinate2D(5.5, 7.5);
      var bez = new CubicBezierBuilderEx(pt1, pt2, pt3, pt4);
      var bezSeg = bez.ToSegment();
      Polyline bezPl = PolylineBuilderEx.CreatePolyline(bezSeg, AttributeFlags.AllAttributes);
    
      //Set symbology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(
        ColorFactory.Instance.BlackRGB, 24, "Comic Sans MS", "Regular");
    
      var ge = ElementFactory.Instance.CreateTextGraphicElement(
        layout, TextType.SplinedText, bezPl, sym, "this is the bezier text",
              "New Bezier Text", true, new ElementInfo() { Anchor = Anchor.CenterPoint });
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also