ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Geometry Namespace / MultipointBuilderEx Class / RemovePoints Method
The index from which the points are removed. Must be in the range [0, Coordinate2Ds.Count - 1] inclusive.
The index up to which the points are removed. Must be in the range [fromIndex, Coordinate2Ds.Count - 1] inclusive. The toIndex is excluded from the indices that are removed. For example, if fromIndex = 3, toIndex = 7, then the points at indices 3, 4, 5, and 6 will be removed.
Example

In This Topic
    RemovePoints Method (MultipointBuilderEx)
    In This Topic
    Remove a range of points.
    Syntax
    Public Sub RemovePoints( _
       ByVal fromIndex As Integer, _
       ByVal toIndex As Integer _
    ) 
    public void RemovePoints( 
       int fromIndex,
       int toIndex
    )

    Parameters

    fromIndex
    The index from which the points are removed. Must be in the range [0, Coordinate2Ds.Count - 1] inclusive.
    toIndex
    The index up to which the points are removed. Must be in the range [fromIndex, Coordinate2Ds.Count - 1] inclusive. The toIndex is excluded from the indices that are removed. For example, if fromIndex = 3, toIndex = 7, then the points at indices 3, 4, 5, and 6 will be removed.
    Exceptions
    ExceptionDescription
    The range is out of bounds.
    Remarks
    If a point has Zs, Ms, or IDs, then the attributes will also be removed from the corresponding lists.
    Example
    Construct a Multipoint - using MultipointBuilderEx
    {
      Coordinate2D[] coordinate2Ds = new Coordinate2D[] { new Coordinate2D(1, 2), new Coordinate2D(-1, -2) };
      SpatialReference sr = SpatialReferences.WGS84;
    
      MultipointBuilderEx builder = new MultipointBuilderEx(coordinate2Ds, sr);
    
      // builder.PointCount = 2
    
      builder.HasZ = true;
      // builder.Zs.Count = 2
      // builder.Zs[0] = 0
      // builder.Zs[1] = 0
    
      builder.HasM = true;
      // builder.Ms.Count = 2
      // builder.Ms[0] = NaN
      // builder.Ms[1] = NaN
    
      builder.HasID = true;
      // builder.IDs.Count = 2
      // builder.IDs[0] = 0
      // builder.IDs[1] = 0
    
      // set it empty
      builder.SetEmpty();
      // builder.Coords.Count = 0
      // builder.Zs.Count = 0
      // builder.Ms.Count = 0
      // builder.IDs.Count = 0
    
    
      // reset coordinates
      List<Coordinate2D> inCoords = new List<Coordinate2D>() { new Coordinate2D(1, 2), new Coordinate2D(3, 4), new Coordinate2D(5, 6) };
      builder.Coordinate2Ds = inCoords;
      // builder.Coords.Count = 3
      // builder.HasZ = true
      // builder.HasM = true
      // builder.HasID = true
    
      double[] zs = new double[] { 1, 2, 1, 2, 1, 2 };
      builder.Zs = zs;
      // builder.Zs.Count = 6
    
      double[] ms = new double[] { 0, 1 };
      builder.Ms = ms;
      // builder.Ms.Count = 2
    
      // coordinates are now   (x, y, z, m, id)
      //  (1, 2, 1, 0, 0), (3, 4, 2, 1, 0) (5, 6, 1, NaN, 0)
    
      MapPoint mapPointFromBuilder = builder.GetPoint(2);
      // mapPoint.HasZ = true
      // mapPoint.HasM = true
      // mapPoint.HasID = true
      // mapPoint.Z  = 1
      // mapPoint.M = NaN
      // mapPoint.ID = 0
    
      // add an M to the list
      builder.Ms.Add(2);
      // builder.Ms.count = 3
    
      // coordinates are now   (x, y, z, m, id)
      //  (1, 2, 1, 0, 0), (3, 4, 2, 1, 0) (5, 6, 1, 2, 0)
    
      // now get the 2nd point again; it will now have an M value
      mapPointFromBuilder = builder.GetPoint(2);
      // mapPoint.M = 2
    
    
      int[] ids = new int[] { -1, -2, -3 };
      // assign ID values
      builder.IDs = ids;
    
      // coordinates are now   (x, y, z, m, id)
      //  (1, 2, 1, 0, -1), (3, 4, 2, 1, -2) (5, 6, 1, 2, -3)
    
    
      // create a new point
      MapPoint pointFromBuilder = MapPointBuilderEx.CreateMapPoint(-300, 400, 4);
      builder.SetPoint(2, pointFromBuilder);
    
      // coordinates are now   (x, y, z, m, id)
      //  (1, 2, 1, 0, -1), (3, 4, 2, 1, -2) (-300, 400, 4, NaN, 0)
    
    
      builder.RemovePoints(1, 3);
      // builder.PointCount = 1
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also