ArcGIS Pro 2.8 API Reference Guide
GetMsAtDistance Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : GetMsAtDistance Method
The multipart from which to get the M values.
The distance along the multipart to retrieve the M values.
Indicates whether the distance should be interpreted as length or ratio along the multipart.
The M value at the specified distance.
The second M value, if there is one. If the specified distance is not at the beginning or the ending of a part, then this value is NaN.
Get the M values at the specified distance along the multipart. Two M values can be returned if the specified distance is exactly at the beginning or the ending of a part.
Syntax
public void GetMsAtDistance( 
   Multipart multipart,
   double distance,
   AsRatioOrLength asRatioOrLength,
   out double m1,
   out double m2
)
Public Sub GetMsAtDistance( _
   ByVal multipart As Multipart, _
   ByVal distance As Double, _
   ByVal asRatioOrLength As AsRatioOrLength, _
   ByRef m1 As Double, _
   ByRef m2 As Double _
) 

Parameters

multipart
The multipart from which to get the M values.
distance
The distance along the multipart to retrieve the M values.
asRatioOrLength
Indicates whether the distance should be interpreted as length or ratio along the multipart.
m1
The M value at the specified distance.
m2
The second M value, if there is one. If the specified distance is not at the beginning or the ending of a part, then this value is NaN.
Exceptions
ExceptionDescription
The input multipart is null.
The input multipart is not M-aware.
Example
string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,-3],[-2000,-2000,-2]],[[-2000,-2000,1],[-2000,1000,2]]],\"spatialReference\":{\"wkid\":3857}}";
Polyline polyline = PolylineBuilder.FromJson(json);
      
// polyline has 2 parts

double m1, m2;
GeometryEngine.Instance.GetMsAtDistance(polyline, 0, AsRatioOrLength.AsLength, out m1, out m2);
// m1 = -3
// m2 = NaN

GeometryEngine.Instance.GetMsAtDistance(polyline, 500, AsRatioOrLength.AsLength, out m1, out m2);
// m1 = -2.5
// m2 = NaN

GeometryEngine.Instance.GetMsAtDistance(polyline, 1000, AsRatioOrLength.AsLength, out m1, out m2);
// m1 = -2
// m2 = 1     // m2 has a value because distance 1000 is at the end of the first part, beginning of the second part
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GeometryEngine Class
GeometryEngine Members