Hi,
I have faced the issue to build Arc while using LineBuilderEx class. Could you please suggest which method I have to use to create Arc.
Hi @JAYAKUMARKUMAR ,
For building Arc in ArcGIS pro .net SDK, you can use EllipticArcBuilderEx or CircularArcBuilderEx depending on your requirements.
Following is the sample code to handle arcs
switch (segmentType)
{
case SegmentType.EllipticArc:
var ellipticArcSegment = segment as EllipticArcSegment;
var ellipticArcBuilder = new EllipticArcBuilderEx(startPoint, endPoint, ellipticArcSegment.CenterPoint,
ellipticArcSegment.IsCounterClockwise ? ArcOrientation.ArcCounterClockwise : ArcOrientation.ArcClockwise);
var newEllipticArcSegment = ellipticArcBuilder.ToSegment();
polylineBuilder.ReplaceSegment(i, j, newEllipticArcSegment);
arcflag = true;
break;
case SegmentType.CircularArc:
var circularArcBuilder = new CircularArcBuilderEx(startPoint, endPoint, segment.Length);
var newCircularArcSegment = circularArcBuilder.ToSegment();
polylineBuilder.ReplaceSegment(i, j, newCircularArcSegment);
arcflag = true;
break;
default:
// Handle other segment types (e.g., lines, cubic Beziers)
break;
}