﻿ GetMMonotonicity Method (GeometryEngine)—ArcGIS Pro
ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / GetMMonotonicity Method
The multipart to check for monotonicity.
Example

In This Topic
GetMMonotonicity Method (GeometryEngine)
In This Topic
Gets a combination of Monotonicity values that describes all trends in the M-values over the length of the multipart.
Syntax
```public Monotonicity GetMMonotonicity(
Multipart multipart
)```
```Public Function GetMMonotonicity( _
ByVal multipart As Multipart _
) As Monotonicity```

#### Parameters

multipart
The multipart to check for monotonicity.

#### Return Value

A combination of Monotonicity values.
Exceptions
ExceptionDescription
Multipart is null.
The multipart is not M-Aware.
Remarks
The Ms are increasing if the Ms are ordered such that M1 < M2 < M3 < . . . < Mn. The Ms are descreasing if the Ms are ordered such that M1 > M2 > M3 > . . . > Mn
Example
Get a combination of monotonicity values that describes all trends in the M-values over the length of the multipart - GetMMonotonicity
```string json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,5],[-1000,-2000,0]]]}";
Polyline polyline = PolylineBuilderEx.FromJson(json);
Monotonicity monotonicity = GeometryEngine.Instance.GetMMonotonicity(polyline);
// monotonicity = Monotonicity.ValueDecreases

// Create a polygon from the polyline
Polygon polygon = PolygonBuilderEx.CreatePolygon(polyline);
monotonicity = GeometryEngine.Instance.GetMMonotonicity(polygon);
// monotonicity = ValueIncreases | ValueDecreases

json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,10],[-2000,-2000,10],[-1000,-2000,10]]]}";
polyline = PolylineBuilderEx.FromJson(json);
monotonicity = GeometryEngine.Instance.GetMMonotonicity(polygon);
// monotonicity = Monotonicity.ValueLevel

json = "{\"hasM\":true,\"paths\":[[[-3000,-2000,null],[-2000,-2000,5],[-1000,-2000,10]]]}";
polyline = PolylineBuilderEx.FromJson(json);
monotonicity = GeometryEngine.Instance.GetMMonotonicity(polyline);
// monotonicity = ValueIncreases | ValueEmpty

// Create an empty polyline
Polyline emptyPolyline = PolylineBuilderEx.FromJson("{\"hasM\":true,\"paths\":[]}");
monotonicity = GeometryEngine.Instance.GetMMonotonicity(emptyPolyline);
// monotonicity = Monotonicity.None
```
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.3 or higher.