ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / InterpolateMsBetween Method
The multipart to copy and update.
The index of the part to start from.
The index of the point to start from. The point index is relative to the part.
The index of the part to end with.
The index of the point to end with. The point index is relative to the part.
Example Version

InterpolateMsBetween Method (GeometryEngine)
Generates M-values by linear interpolation over a range of points.
Syntax
public Multipart InterpolateMsBetween( 
   Multipart multipart,
   int fromPart,
   int fromPoint,
   int toPart,
   int toPoint
)

Parameters

multipart
The multipart to copy and update.
fromPart
The index of the part to start from.
fromPoint
The index of the point to start from. The point index is relative to the part.
toPart
The index of the part to end with.
toPoint
The index of the point to end with. The point index is relative to the part.

Return Value

An updated version of the input multipart.
Exceptions
ExceptionDescription
The input multipart is null.
The input multipart is not M-Aware.
M-values cannot be interpolated.
Example
Generates M-values by linear interpolation over a range of points - InterpolateMsBetween
string json = "{\"hasM\":true,\"paths\":[[[0,0,-1],[1,0,0],[1,1,1],[1,2,2],[3,1,3],[5,3,4],[9,5,5],[7,6,6]]],\"spatialReference\":{\"wkid\":4326}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);

// Interpolate between points 2 and 6
Polyline outPolyline = GeometryEngine.Instance.InterpolateMsBetween(polyline, 0, 2, 0, 6) as Polyline;
// The points of the output polyline are
// (0, 0, -1), (1, 0, 0), (1, 1, 1), (1, 2, 1.3796279833912741), (3, 1, 2.2285019604153242), (5, 3, 3.3022520459518998), (9, 5, 5), (7, 6, 6)
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also