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

ArcGIS.Core.Geometry Namespace > IGeometryEngine Interface : CalculateNonSimpleMs Method
The multipart to calculate M-values for.
The value to which NaN M-values that could not be interpolated will be set.
Calculates M attribute values for each non-simple (NaN) M-value from existing simple (non-NaN) M attributes on the specified geometry. The non-simple M values are obtained by extrapolation/interpolation for polylines and interpolation for polygons.
Syntax
Multipart CalculateNonSimpleMs( 
   Multipart multipart,
   double defaultMValue
)
Function CalculateNonSimpleMs( _
   ByVal multipart As Multipart, _
   ByVal defaultMValue As Double _
) As Multipart

Parameters

multipart
The multipart to calculate M-values for.
defaultMValue
The value to which NaN M-values that could not be interpolated will be set.

Return Value

A geometry in which each coordinate has a simple (non-NaN) M value.
Exceptions
ExceptionDescription
Multipart is null or empty.
This geometry is not M-Aware.
Example
List<MapPoint> coords = new List<MapPoint>()
{
  MapPointBuilder.CreateMapPoint(0, 0, 0, 0),
  MapPointBuilder.CreateMapPoint(0, 1000),
  MapPointBuilder.CreateMapPoint(1000, 1000, 10, 50)
};

SpatialReference sr = SpatialReferences.WebMercator;

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

// polygon.HasM = true
// polygon.Points[1].HasM = true
// polygon.Points[1].M = NaN

Polygon polygonNoNaNMs = GeometryEngine.Instance.CalculateNonSimpleMs(polygon, 0) as Polygon;

// polygonNoNaNMs.Points[1].HasM = true
// polygonNoNaNMs.Points[1].M = 25  (halfway between 0 and 50)
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

IGeometryEngine Interface
IGeometryEngine Members