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

In This Topic
    MultiplyMs Method (GeometryEngine)
    In This Topic
    Multiplies all the M-values by a factor.
    Syntax
    Public Function MultiplyMs( _
       ByVal geometry As Geometry, _
       ByVal factor As Double _
    ) As Geometry
    public Geometry MultiplyMs( 
       Geometry geometry,
       double factor
    )

    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(-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 = [1, 2, 3, 4, 5, 6, 7, 8];
    
      MultipointBuilderEx builder = new(coords)
      {
        Ms = ms,
        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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.3 or higher.
    See Also