Public Shadows Function ToSegment() As EllipticArcSegment
public new EllipticArcSegment ToSegment()
Return Value
An EllipticArc segment.
Public Shadows Function ToSegment() As EllipticArcSegment
public new EllipticArcSegment ToSegment()
{
// Construct a circular arc from (2, 1) to (1, 2) with interior pt (1 + sqrt(2)/2, 1 + sqrt(2)/2).
// Use a builderEx convenience method or use a builderEx constructor.
MapPoint fromPtCircArc = MapPointBuilderEx.CreateMapPoint(2, 1);
MapPoint toPtCircArc = MapPointBuilderEx.CreateMapPoint(1, 2);
Coordinate2D interiorPtNew = new Coordinate2D(1 + Math.Sqrt(2) / 2, 1 + Math.Sqrt(2) / 2);
// BuilderEx convenience methods don't need to run on the MCT.
EllipticArcSegment circularArcBuilder = EllipticArcBuilderEx.CreateCircularArc(fromPtCircArc, toPtCircArc, interiorPtNew);
// BuilderEx constructors don't need to run on the MCT.
EllipticArcBuilderEx eab = new EllipticArcBuilderEx(fromPtCircArc, toPtCircArc, interiorPtNew);
// do something with the builder
EllipticArcSegment anotherCircularArc = eab.ToSegment();
}
{
// Construct a circular arc counterclockwise from (2, 1) to (1, 2) such that the embedded
// circle has center point at (1, 1) and radius = 1.
// Use a builderEx convenience method or use a builderEx constructor.
MapPoint fromPtArc = MapPointBuilderEx.CreateMapPoint(2, 1, SpatialReferences.WGS84);
double chordLength = Math.Sqrt(2);
double chordBearing = 3 * Math.PI / 4;
double radius = 1;
ArcOrientation orientation = ArcOrientation.ArcCounterClockwise;
MinorOrMajor minorOrMajor = MinorOrMajor.Minor;
// BuildeEx convenience methods don't need to run on the MCT.
EllipticArcSegment circularArcBuilder = EllipticArcBuilderEx.CreateCircularArc(fromPtArc, chordLength, chordBearing, radius, orientation, minorOrMajor);
// BuilderEx constructors don't need to run on the MCT either.
EllipticArcBuilderEx ellipticArcBuilderEx = new EllipticArcBuilderEx(fromPtArc, chordLength, chordBearing, radius, orientation, minorOrMajor);
// do something with the builder
EllipticArcSegment anotherCircularArc = ellipticArcBuilderEx.ToSegment();
}
{
// Construct a circular arc with center point at (0, 0), from angle = 0,
// central angle = pi/2, radius = 1.
// Use a builderEx convenience method or use a builderEx constructor.
SpatialReference sr4326 = SpatialReferences.WGS84;
Coordinate2D centerPt = new Coordinate2D(0, 0);
double fromAngle = 0;
double centralAngle = Math.PI / 2;
double radius = 1;
// BuilderEx convenience methods don't need to run on the MCT.
EllipticArcSegment circularArcBuilder = EllipticArcBuilderEx.CreateCircularArc(fromAngle, centralAngle, centerPt, radius, sr4326);
// BuilderEx constructors don't need to run on the MCT.
EllipticArcBuilderEx ellipticArcBuilderEx = new EllipticArcBuilderEx(fromAngle, centralAngle, centerPt, radius, sr4326);
ellipticArcSegment = ellipticArcBuilderEx.ToSegment();
}
{
//Note: 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 symbology, 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(
layout, TextType.CircleParagraph, poly, sym, text, "New Circle Text", false);
}
{
//Note: 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 symbology, 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(
layout, TextType.PolygonParagraph, poly, sym, text, "New Ellipse Text", false);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)