EllipticArcBuilderEx Constructor(Coordinate2D,Double,Double,Double,ArcOrientation,SpatialReference)
Creates a new instance of the EllipticArcBuilderEx class.
The new instance will be an ellipse.
Parameters
- centerPt
- The center point of the ellipse.
- rotationAngle
- The angle in radians by which the ellipse is rotated from the X-axis. A positive value corresponds to counterclockwise rotation.
- semiMajorAxis
- The length of the semi-major axis.
- minorMajorRatio
- The ratio of the length of the semi-minor axis to the length of the semi-major axis. The absolute value must be <= 1.
- orientation
- The orientation of the arc, clockwise or counterclockwise.
- spatialReference
- (Optional) The spatial reference of the arc. The default value is null.
Construct an Ellipse
// Construct an ellipse centered at (1, 2) with rotationAngle = -pi/6,
// semiMajorAxis = 5, minorMajorRatio = 0.2, oriented clockwise.
// Use a builderEx convenience method or use a builderEx constructor.
Coordinate2D centerPt = new Coordinate2D(1, 2);
// BuilderEx convenience methods don't need to run on the MCT.
EllipticArcSegment ellipse = EllipticArcBuilderEx.CreateEllipse(centerPt, -1 * Math.PI / 6, 5, 0.2, ArcOrientation.ArcClockwise);
// This EllipticArcBuilderEx constructor doesn't need to run on the MCT.
EllipticArcBuilderEx builder = new EllipticArcBuilderEx(centerPt, -1 * Math.PI / 6, 5, 0.2, ArcOrientation.ArcClockwise);
EllipticArcSegment anotherEllipse = builder.ToSegment();
Create Circle Text Element
//Must be on QueuedTask.Run(() => { ...
//Build geometry
Coordinate2D center = new Coordinate2D(4.5, 4);
var eabCir = new EllipticArcBuilderEx(center, 0.5, ArcOrientation.ArcClockwise);
var cir = eabCir.ToSegment();
var poly = PolygonBuilderEx.CreatePolygon(
PolylineBuilderEx.CreatePolyline(cir, AttributeFlags.AllAttributes));
//Set symbolology, create and add element to layout
CIMTextSymbol sym = SymbolFactory.Instance.ConstructTextSymbol(
ColorFactory.Instance.GreenRGB, 10, "Arial", "Regular");
string text = "Circle, circle, circle";
GraphicElement cirTxtElm = ElementFactory.Instance.CreateTextGraphicElement(
container, TextType.CircleParagraph, poly, sym, text, "New Circle Text", false);
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);
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.0 or higher.