ArcGIS Pro 2.6 API Reference Guide
SetMsAsDistance Method (GeometryEngine)
Example 

ArcGIS.Core.Geometry Namespace > GeometryEngine Class : SetMsAsDistance Method
The multipart in which to set the M values.
Indicates whether the M values are set as lengths or ratios along the multipart.
Sets the M values to the cumulative length from the start of the multipart.
Syntax
Public Function SetMsAsDistance( _
   ByVal multipart As Multipart, _
   ByVal asRatioOrLength As AsRatioOrLength _
) As Multipart

Parameters

multipart
The multipart in which to set the M values.
asRatioOrLength
Indicates whether the M values are set as lengths or ratios along the multipart.

Return Value

Multipart with M values set.
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,\"rings\":[[[0,0],[0,3000],[4000,3000],[4000,0],[0,0]]],\"spatialReference\":{\"wkid\":3857}}";
Polygon polygon = PolygonBuilder.FromJson(json);

Polygon outPolygon = GeometryEngine.Instance.SetMsAsDistance(polygon, AsRatioOrLength.AsLength) as Polygon;
ReadOnlyPointCollection outPoints = outPolygon.Points;
// outPoints M values are { 0, 3000, 7000, 10000, 14000 };
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

GeometryEngine Class
GeometryEngine Members