ArcGIS Pro 3.2 API Reference Guide
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
Example

In This Topic
    GetSubCurveBetweenMs Method (IGeometryEngine)
    In This Topic
    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
    Get a polyline corresponding to the subcurves between specified M values - GetSubCurveBetweenMs
    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 = PolylineBuilderEx.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 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also