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


IGeometryCollection.Geometry Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryCollection Interface > IGeometryCollection.Geometry Property
ArcGIS Developer Help

IGeometryCollection.Geometry Property

A reference to the ith geometry.

[Visual Basic .NET]
Public Function get_Geometry ( _
    ByVal Index As Integer _
) As IGeometry
[C#]
public IGeometry get_Geometry (
    int Index
);
[C++]
HRESULT get_Geometry(
  long Index,
  IGeometry** outPart
);
[C++]
Parameters
Index 

Index is a parameter of type long outPart [out, retval]
outPart is a parameter of type IGeometry**

Product Availability

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

Description

Returns the ith Geometry from the GeometryCollection.  The first Geometry has index 0 and the last Geometry has index equal to GeometryCount - 1.  The last Geometry can also be referenced using index -1.

Remarks

Note: The GeometryType returned by the Geometry method depends on which object type points the IGeometryCollection pointer.

IGeometryCollection Object GeometryType Returned Object GeometryType
Polygon
Rings
Polyline
Paths
Multipoint
Points
Multipatch
TriangleFans or TriangleStrips or Rings
TriangleFan
Points
TriangleStrip
Points
Geometry Bag
Any type of IGeometry

See Also

IGeometryCollection Interface

.NET Samples

3D multipatch examples 3D multipatch examples 3D multipatch examples