This document is archived and information here might be outdated.  Recommended version.


IGeometryBridge.InsertGeometries Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryBridge Interface > IGeometryBridge.InsertGeometries Method
ArcGIS Developer Help

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,
  SAFEARRAY(IGeometry)** 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 SAFEARRAY(IGeometry*)*

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