ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / MultiplyMs Method
The input geometry. Cannot be a GeometryBag.
The factor by which each M-value will be multiplied.
Example Version

MultiplyMs Method (IGeometryEngine)
Multiplies all the M-values by a factor.
Syntax

Parameters

geometry
The input geometry. Cannot be a GeometryBag.
factor
The factor by which each M-value will be multiplied.

Return Value

A geometry with all the M-values multiplied by a factor. If factor is NaN or geometry is empty, then the input geometry is returned unchanged.
Exceptions
ExceptionDescription
Geometry is null.
This geometry is not M-Aware.
This method is not implemented for GeometryBag.
Example
Multiply all M-values by a factor - MultiplyMs
// Create a multipoint and multiply M-values by 6
Coordinate2D[] coords = new Coordinate2D[] { new Coordinate2D(-4, 4), new Coordinate2D(-1, 1), new Coordinate2D(2, 6),
  new Coordinate2D(-8, 2), new Coordinate2D(5, -3), new Coordinate2D(7, 2), new Coordinate2D(5, 3), new Coordinate2D(3, -1) };

double[] ms = new double[] { 1, 2, 3, 4, 5, 6, 7, 8 };

MultipointBuilderEx builder = new MultipointBuilderEx(coords);
builder.Ms = ms;
builder.HasM = true;
Multipoint multipoint = builder.ToGeometry();

Multipoint outMultipoint = GeometryEngine.Instance.MultiplyMs(multipoint, 6) as Multipoint;
// The xy-values of the points in outMultipoint are the same as the points in the input multipoint.
// The M-values in outMultipoint are { 6, 12, 18, 24, 30, 36, 42, 48 }
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.3 or higher.
See Also