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


IGeometryBridge.SetGeometries 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.SetGeometries Method
ArcGIS Developer Help

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,
  SAFEARRAY(IGeometry)** newGeometries
);
[C++]
Parameters
pGeometryCollection [in]

pGeometryCollection is a parameter of type IGeometryCollection* 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::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