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


IGeometryBridge.SetGeometries Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

IGeometryBridge.SetGeometries Method

Replaces all geometries in the collection with the specified number of references to those in the input array.

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

Parameters pGeometryCollection [in]
pGeometryCollection is a parameter of type IGeometryCollection 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::SetGeometries .

[C#]

    public void SetGeometries()
    {
        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;

        IGeometryCollection geometryCollection=new MultipointClass();
        IGeometryBridge geometryBridge=new GeometryEnvironmentClass();
        //override all existing geometries and insert geometries from geometryArray
        geometryBridge.SetGeometries(geometryCollection, ref geometryArray);
    }

See Also

IGeometryBridge Interface