ArcGIS Pro 2.8 API Reference Guide
GetSubCurve Method (IGeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : GetSubCurve Method
The multipart from which the subcurve will be extracted.
The distance along the multipart to start the subcurve.
The distance along the multipart to end the subcurve.
Indicates whether the fromDistance and toDistance are given as lengths or ratios along the multipart.
Gets the subcurve of the input multipart between fromDistance and toDistance.
Syntax

Parameters

multipart
The multipart from which the subcurve will be extracted.
fromDistance
The distance along the multipart to start the subcurve.
toDistance
The distance along the multipart to end the subcurve.
asRatioOrLength
Indicates whether the fromDistance and toDistance are given as lengths or ratios along the multipart.

Return Value

The polyline representing the subcurve.
Exceptions
ExceptionDescription
Multipart is null or empty.
Example
SpatialReference sr = SpatialReferences.WGS84;

List<Coordinate2D> coords = new List<Coordinate2D>()
{
  new Coordinate2D(-111, 72),
  new Coordinate2D(-108, 68),
  new Coordinate2D(-114, 68)
};

Polyline polyline = PolylineBuilder.CreatePolyline(coords, sr);

Polyline subCurve = GeometryEngine.Instance.GetSubCurve(polyline, 0, 5, AsRatioOrLength.AsLength);
// subCurve.PartCount = 1
// subCurve.PointCount = 2

ReadOnlyPointCollection points = subCurve.Points;
// points[0] = -111, 72
// points[1] = -108, 68

subCurve = GeometryEngine.Instance.GetSubCurve(polyline, 0, 0.5, AsRatioOrLength.AsRatio);
// subCurve.PointCount = 3

points = subCurve.Points;
// points[0] = -111, 72
// points[1] = -108, 68
// points[2] = -108.5, 68


List<Coordinate3D> coords3D = new List<Coordinate3D>()
{
  new Coordinate3D(0, 0, 0),
  new Coordinate3D(0, 1, 1),
  new Coordinate3D(1, 1, 2),
  new Coordinate3D(1, 0, 3)
};

Polygon polygon = PolygonBuilder.CreatePolygon(coords3D, sr);

subCurve = GeometryEngine.Instance.GetSubCurve3D(polygon, 0, 1, AsRatioOrLength.AsLength);
// subCurve.HasZ = true

points = subCurve.Points;
// points.Count = 2
// points[0] = 0, 0, 0
// points[1] = 0, 0.70710678118654746, 0.70710678118654746
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members