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


IGeometryCollection.Geometry Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

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 (Code Files: CompositeExamples GeometryUtilities GraphicsLayer3DUtilities)

.NET Related Topics

How to modify a specific segment of a polyline | How to modify a specific vertex of a polyline