ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / ArcOrientation Enumeration
Example Example

In This Topic
    ArcOrientation Enumeration
    In This Topic
    Describes the orientation of an EllipticArcSegment. The orientation is defined as the direction between the 'from' and 'to' points of the arc.
    Syntax
    Members
    MemberDescription
    ArcClockwise The arc proceeds clockwise from its 'from' point to its 'to' point.
    ArcCounterClockwise The arc proceeds counterclockwise from its 'from' point to its 'to' point
    Example
    Construct a Clothoid by Length
    MapPoint startPoint = MapPointBuilderEx.CreateMapPoint(0, 0);
    MapPoint queryPoint = MapPointBuilderEx.CreateMapPoint(3.8, 1);
    double tangentDirection = 0;
    ArcOrientation orientation = ArcOrientation.ArcCounterClockwise;
    double startRadius = double.PositiveInfinity;
    double endRadius = 1;
    ClothoidCreateMethod createMethod = ClothoidCreateMethod.ByLength;
    double curveLength = 10;
    MapPoint pointOnPath;
    double radiusCalculated, tangentDirectionCalculated, lengthCalculated, angleCalculated;
    
    
    PolylineBuilderEx.QueryClothoidParameters(queryPoint, startPoint, tangentDirection, startRadius, endRadius, orientation, createMethod, curveLength, out pointOnPath, out radiusCalculated, out tangentDirectionCalculated, out lengthCalculated, out angleCalculated, SpatialReferences.WGS84);
    
    pointOnPath = MapPointBuilderEx.CreateMapPoint(3.7652656620171379, 1.0332006103128575);
    radiusCalculated = 2.4876382887687227;
    tangentDirectionCalculated = 0.80797056423543978;
    lengthCalculated = 4.0198770235802987;
    angleCalculated = 0.80797056423544011;
    
    queryPoint = MapPointBuilderEx.CreateMapPoint(1.85, 2.6);
    
    PolylineBuilderEx.QueryClothoidParameters(queryPoint, startPoint, tangentDirection, startRadius, endRadius, orientation, createMethod, curveLength, out pointOnPath, out radiusCalculated, out tangentDirectionCalculated, out lengthCalculated, out angleCalculated, SpatialReferences.WGS84);
    
    pointOnPath = MapPointBuilderEx.CreateMapPoint(1.8409964973501549, 2.6115979967308132);
    radiusCalculated = 1;
    tangentDirectionCalculated = -1.2831853071795867;
    lengthCalculated = 10;
    angleCalculated = 5;
     
    tangentDirection = Math.PI / 4;
    orientation = ArcOrientation.ArcClockwise;
    startRadius = double.PositiveInfinity;
    endRadius = 0.8;
    createMethod = ClothoidCreateMethod.ByLength;
    curveLength = 10;
    
    Polyline polyline = PolylineBuilderEx.CreatePolyline(startPoint, tangentDirection, startRadius, endRadius, orientation, createMethod, curveLength, CurveDensifyMethod.ByLength, 0.5, SpatialReferences.WGS84);
    
    Construct a Circle
    // Construct a circle with center at (-1,-1), radius = 2, and oriented clockwise.
    // Use a builderEx convenience method or use a builderEx constructor.
    
    Coordinate2D centerPtCoord = new Coordinate2D(-1, -1);
    
    // Builder convenience methods don't need to run on the MCT.
    EllipticArcSegment circle = EllipticArcBuilderEx.CreateCircle(centerPtCoord, 2, ArcOrientation.ArcClockwise);
    // circle.IsCircular = true
    // circle.IsCounterClockwise = false
    // circle.IsMinor = false
    
    double startAngle, rotationAngle, centralAngle, semiMajor, semiMinor;
    Coordinate2D actualCenterPt;
    circle.QueryCoords(out actualCenterPt, out startAngle, out centralAngle, out rotationAngle, out semiMajor, out semiMinor);
    
    // semiMajor = 2.0
    // semiMinor = 2.0
    // startAngle = PI/2
    // centralAngle = -2*PI
    // rotationAngle = 0
    // endAngle = PI/2
    
    // This EllipticArcBuilderEx constructor doesn't need to run on the MCT.
    EllipticArcBuilderEx builder = new EllipticArcBuilderEx(centerPtCoord, 2, ArcOrientation.ArcClockwise);
    EllipticArcSegment otherCircle = builder.ToSegment();
    
    Create_circle
    //Create a circle graphic element using a simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(2, 4);
      //At 2.x - EllipticArcBuilder eabCir = new EllipticArcBuilder(center, 0.5, esriArcOrientation.esriArcClockwise);
      var eabCir = new EllipticArcBuilderEx(center, 0.5, ArcOrientation.ArcClockwise);
      EllipticArcSegment cir = eabCir.ToSegment();
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Dash);
      CIMPolygonSymbol circleSym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid, outline);
      //At 2.x - GraphicElement cirElm = LayoutElementFactory.Instance.CreateCircleGraphicElement(layout, cir, circleSym);
      //         cirElm.SetName("New Circle");
    
      var polyLine = PolylineBuilderEx.CreatePolyline(cir);
      GraphicElement cirElm = ElementFactory.Instance.CreateGraphicElement(layout, polyLine, circleSym, "New Circle");
    });
    Create_ellipse
    //Create an ellipse graphic with simple line and fill styles.
    
    //Construct on the worker thread
    await QueuedTask.Run(() =>
    {
      //Build geometry
      Coordinate2D center = new Coordinate2D(2, 2.75);
      //At 2.x - EllipticArcBuilder eabElp = new EllipticArcBuilder(center, 0, 1, 0.45, esriArcOrientation.esriArcClockwise);
      var eabElp = new EllipticArcBuilderEx(center, 0, 1, 0.45, ArcOrientation.ArcClockwise);
      EllipticArcSegment ellipse = eabElp.ToSegment();
    
      //Set symbolology, create and add element to layout
      CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.GreenRGB, 2.0, SimpleLineStyle.Dot);
      CIMPolygonSymbol ellipseSym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.GreyRGB, SimpleFillStyle.Vertical, outline);
      //At 2.x - GraphicElement elpElm = LayoutElementFactory.Instance.CreateEllipseGraphicElement(layout, ellipse, ellipseSym);
      //         elpElm.SetName("New Ellipse");
    
      var polyLine = PolylineBuilderEx.CreatePolyline(ellipse);
      GraphicElement elpElm = ElementFactory.Instance.CreateGraphicElement(layout, polyLine, ellipseSym, "New Ellipse");
    });
    Create Circle Graphic
    //Must be on QueuedTask.Run(() => { ...
    
    //Build geometry
    Coordinate2D center = new Coordinate2D(2, 4);
    EllipticArcSegment circle_seg = EllipticArcBuilderEx.CreateCircle(
      new Coordinate2D(2, 4), 0.5, ArcOrientation.ArcClockwise, null);
    var circle_poly = PolygonBuilderEx.CreatePolygon(PolylineBuilderEx.CreatePolyline(circle_seg));
    
    //PolylineBuilderEx.CreatePolyline(cir, AttributeFlags.AllAttributes));
    //Set symbolology, create and add element to layout
    CIMStroke outline = SymbolFactory.Instance.ConstructStroke(
      ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Dash);
    
    CIMPolygonSymbol circleSym = SymbolFactory.Instance.ConstructPolygonSymbol(
      ColorFactory.Instance.RedRGB, SimpleFillStyle.Solid, outline);
    SymbolFactory.Instance.ConstructPolygonSymbol(null,
      SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.RedRGB, 2));
    
    var circleGraphic = GraphicFactory.Instance.CreateSimpleGraphic(circle_poly, circleSym);
    
    //Make an element to add to GraphicsLayer or Layout
    //var elemInfo = new ElementInfo() { Anchor = Anchor.CenterPoint };
    //GraphicElement cirElm = ElementFactory.Instance.CreateGraphicElement(
    //  container, circleGraphic, "New Circle", true, elemInfo);
    
    Create Ellipse Text Element
    //Must be on QueuedTask.Run(() => { ...
    
    //Build geometry
    Coordinate2D center = new Coordinate2D(4.5, 2.75);
    var eabElp = new EllipticArcBuilderEx(center, 0, 1, 0.45, ArcOrientation.ArcClockwise);
    var ellipse = eabElp.ToSegment();
    
    var poly = PolygonBuilderEx.CreatePolygon(
      PolylineBuilderEx.CreatePolyline(ellipse, AttributeFlags.AllAttributes));
    
    //Set symbolology, create and add element to layout
    CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(
                          ColorFactory.Instance.BlueRGB, 10, "Arial", "Regular");
    string text = "Ellipse, ellipse, ellipse";
    
    GraphicElement ge = ElementFactory.Instance.CreateTextGraphicElement(
      container, TextType.PolygonParagraph, poly, sym, text, "New Ellipse Text", false);
    
    Create Predefined Shape Graphic Element
    //Must be on QueuedTask.Run(() => { ...
    
    //PredefinedShape shapeType =
    //              PredefinedShape.Circle | Cloud | Cross |Circle | Triangle | ... ;
    
    //Build geometry
    Coordinate2D ll = new Coordinate2D(4, 2.5);
    Coordinate2D ur = new Coordinate2D(6, 4.5);
    Envelope env = EnvelopeBuilderEx.CreateEnvelope(ll, ur);
    
    var outline = SymbolFactory.Instance.ConstructStroke(
                    ColorFactory.Instance.BlueRGB, 2);
    var poly_sym = SymbolFactory.Instance.ConstructPolygonSymbol(
                     null, outline);
    
    var ge = ElementFactory.Instance.CreatePredefinedShapeGraphicElement(
                           container, shapeType, env.Center, env.Width, env.Height, 
                            poly_sym, shapeType.ToString(), true);
    
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.Geometry.ArcOrientation

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also