ArcGIS Pro 2.7 API Reference Guide
GetSubCurveBetweenMs Method (IGeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : GetSubCurveBetweenMs Method
The multipart from which the subcurve will be extracted.
The m-value in the multipart to start the subcurve.
The m-value in the multipart to end the subcurve
Gets a polyline corresponding to the subcurve(s) between the specified M values.
Syntax
Polyline GetSubCurveBetweenMs( 
   Multipart multipart,
   double fromM,
   double toM
)
Function GetSubCurveBetweenMs( _
   ByVal multipart As Multipart, _
   ByVal fromM As Double, _
   ByVal toM As Double _
) As Polyline

Parameters

multipart
The multipart from which the subcurve will be extracted.
fromM
The m-value in the multipart to start the subcurve.
toM
The m-value in the multipart to end the subcurve

Return Value

Polyline representing the subcurve.
Exceptions
ExceptionDescription
Multipart is null or empty.
This geometry is not M-Aware.
Spatial reference of multipartis an image coordinate system.
Example
string json = "{\"hasM\":true,\"paths\":[[[-2000,0,1],[-1000,1000,2],[-1000,0,3],[1000,1000,4],[2000,1000,5],[2000,2000,6],[3000,2000,7],[4000,0,8]]],\"spatialReference\":{\"wkid\":3857}}";
Polyline polyline = PolylineBuilder.FromJson(json);

Polyline subCurve = GeometryEngine.Instance.GetSubCurveBetweenMs(polyline, 2, 6);
// subCurve.PointCount = 5
// subCurve.Points[0]  X= --1000, Y= 1000 M= 2
// subCurve.Points[1]  X= --1000, Y= 0  M= 3
// subCurve.Points[2]  X= 1000, Y= 1000  M= 4
// subCurve.Points[3]  X= 2000, Y= -1000  M= 5
// subCurve.Points[4]  X= 2000, Y= -2000  M= 6

subCurve = GeometryEngine.Instance.GetSubCurveBetweenMs(polyline, double.NaN, 5);
// subCurve.PointCount = 0
// subCurve.IsEmpty = true
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members