ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / CubicBezierBuilderEx Class
Members Example

In This Topic
    CubicBezierBuilderEx Class
    In This Topic
    A builder for creating a CubicBezierSegment whose methods can be called on any thread.
    Object Model
    CubicBezierBuilderEx ClassCoordinate2D StructureCoordinate2D StructureCubicBezierSegment ClassMapPoint ClassSpatialReference ClassMapPoint ClassCubicBezierSegment Class
    Syntax
    public sealed class CubicBezierBuilderEx : SegmentBuilderEx 
    Public NotInheritable Class CubicBezierBuilderEx 
       Inherits SegmentBuilderEx
    Remarks
    Use the CubicBezierBuilderEx class to to create and/or modify a CubicBezierSegment shape. A CubicBezierSegment is based upon the parent Segment class. The Segment class is immutable which means that you can not change its shape once it is created. Hence, the CubicBezierBuilderEx provides the way to make changes when working with a CubicBezierSegment. Use the CubicBezierBuilderEx.ToSegment method to get the CubicBezierSegment from the builder.

    A cubic Bezier curve is a non-linear segment defined by four control points. The Bezier curve starts at control point 0 (start point) and ends at control point 3 (end point). The start point and control point 1 define the tangent at the start point. Control point 2 and the end point define the tangent at the end point. The length of these tangent lines and position of the 4 control points determines the shape of the created Bezier curve.

    Bezier Curves

    The CubicBezierBuilderEx methods can be called on any thread.

    Example
    Create_BezierCurve
    //Create a bezier curve element with a simple line style.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D pt1 = new Coordinate2D(1, 7.5);
      Coordinate2D pt2 = new Coordinate2D(1.66, 8);
      Coordinate2D pt3 = new Coordinate2D(2.33, 7.1);
      Coordinate2D pt4 = new Coordinate2D(3, 7.5);
      //At 2.x - CubicBezierBuilder bez = new CubicBezierBuilder(pt1, pt2, pt3, pt4);
      var bez = new CubicBezierBuilderEx(pt1, pt2, pt3, pt4);
      CubicBezierSegment bezSeg = bez.ToSegment();
      //At 2.x - Polyline bezPl = PolylineBuilder.CreatePolyline(bezSeg);
      Polyline bezPl = PolylineBuilderEx.CreatePolyline(bezSeg);
    
      //Set symbology, create and add element to layout
      CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.RedRGB, 4.0, SimpleLineStyle.DashDot);
      //At 2.x - GraphicElement bezElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, bezPl, lineSym);
      //         bezElm.SetName("New Bezier Curve");
      GraphicElement bezElm = ElementFactory.Instance.CreateGraphicElement(layout, bezPl, lineSym, "New Bezier Curve");
    });
    Create_CurveText
    //Create curve text with basic text properties.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D pt1 = new Coordinate2D(3.6, 7.5);
      Coordinate2D pt2 = new Coordinate2D(4.26, 8);
      Coordinate2D pt3 = new Coordinate2D(4.93, 7.1);
      Coordinate2D pt4 = new Coordinate2D(5.6, 7.5);
      //At 2.x - CubicBezierBuilder bez = new CubicBezierBuilder(pt1, pt2, pt3, pt4);
      var bez = new CubicBezierBuilderEx(pt1, pt2, pt3, pt4);
      CubicBezierSegment bezSeg = bez.ToSegment();
      //At 2.x - Polyline bezPl = PolylineBuilder.CreatePolyline(bezSeg);
      Polyline bezPl = PolylineBuilderEx.CreatePolyline(bezSeg);
    
      //Set symbolology, create and add element to layout
      CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(ColorFactory.Instance.BlackRGB, 24, "Comic Sans MS", "Regular");
      //At 2.x - GraphicElement bezTxtElm = LayoutElementFactory.Instance.CreateCurvedTextGraphicElement(layout, bezPl, "Curved Text", sym);
      //         bezTxtElm.SetName("New Splinned Text");
      GraphicElement bezTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
                                    layout, TextType.SplinedText, bezPl, sym, "Curved Text", "New Splinned Text");
    });
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Geometry.SegmentBuilderEx
          ArcGIS.Core.Geometry.CubicBezierBuilderEx

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also