ArcObjects Library Reference (Geometry)  

IGeometryBridge.InsertGeometries Method

Inserts at the specified index references to some number of geometries in the input array.

[Visual Basic .NET]
Public Sub InsertGeometries ( _
    ByVal pGeometryCollection As IGeometryCollection, _
    ByVal Index As Integer, _
    ByRef newGeometries As IGeometry[] _
)
[C#]
public void InsertGeometries (
    IGeometryCollection pGeometryCollection,
    int Index,
    ref IGeometry[] newGeometries
);
[C++]
HRESULT InsertGeometries(
  IGeometryCollection* pGeometryCollection,
  long Index,
  Array* newGeometries
);
[C++]

Parameters

pGeometryCollection [in]

  pGeometryCollection is a parameter of type IGeometryCollection

Index   Index is a parameter of type long newGeometries [in]   newGeometries is a parameter of type Array

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

All development languages compatible version of IGeometryCollection::InsertGeometries.

[C#]

    public void InsertGeometries()
    {
        IPoint point1 = new PointClass();
        point1.PutCoords(10, 10);

        IPoint point2 = new PointClass();
        point2.PutCoords(20, 20);
        IGeometry[] geometryArray = new IGeometry[2];
        geometryArray[0] = point1 as IGeometry;
        geometryArray[1] = point2 as IGeometry;

        //insert geometries at position 0
        IGeometryCollection geometryCollection = new MultipointClass();
        IGeometryBridge geometryBridge = new GeometryEnvironmentClass();
        geometryBridge.InsertGeometries(geometryCollection, 0, ref geometryArray);
    }

See Also

IGeometryBridge Interface