This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IP > IPolygon4 Interface > IPolygon4.ExteriorRingBag Property (ArcObjects .NET 10.5 SDK) |
Creates and returns a geometry bag that contains references to all exterior rings.
[Visual Basic .NET] Public ReadOnly Property ExteriorRingBag As IGeometryBag
[C#] public IGeometryBag ExteriorRingBag {get;}
[C++]
HRESULT get_ExteriorRingBag(
IGeometryBag** ringBag
);
[C++]
Parameters ringBag [out, retval]
ringBag is a parameter of type IGeometryBag
public static void PolygonToString(IPolygon4 polygon)
{
IGeometryBag exteriorRingGeometryBag=polygon.ExteriorRingBag;
IGeometryCollection exteriorRingGeometryCollection=exteriorRingGeometryBag as IGeometryCollection;
Trace.WriteLine("polygon.ExteriorRingCount=" + exteriorRingGeometryCollection.GeometryCount);
for (int i=0; i < exteriorRingGeometryCollection.GeometryCount; i++)
{
Trace.WriteLine("polygon.ExteriorRing[" + i + "]");
IGeometry exteriorRingGeometry=exteriorRingGeometryCollection.get_Geometry(i);
IPointCollection exteriorRingPointCollection=exteriorRingGeometry as IPointCollection;
for (int j=0; j < exteriorRingPointCollection.PointCount; j++)
{
Trace.WriteLine("Point[" + j + "]=" + PointToString(exteriorRingPointCollection.get_Point(j)));
}
IGeometryBag interiorRingGeometryBag=polygon.get_InteriorRingBag(exteriorRingGeometry as IRing);
IGeometryCollection interiorRingGeometryCollection=interiorRingGeometryBag as IGeometryCollection;
Trace.WriteLine("polygon.InteriorRingCount[exteriorRing" + i + "]=" + interiorRingGeometryCollection.GeometryCount);
for (int k=0; k < interiorRingGeometryCollection.GeometryCount; k++)
{
Trace.WriteLine("polygon.InteriorRing[" + k + "]");
IGeometry interiorRingGeometry=interiorRingGeometryCollection.get_Geometry(k);
IPointCollection interiorRingPointCollection=interiorRingGeometry as IPointCollection;
for (int m=0; m < interiorRingPointCollection.PointCount; m++)
{
Trace.WriteLine("Point[" + m + "]=" + PointToString(interiorRingPointCollection.get_Point(m)));
}
}
}
}
private static string PointToString(IPoint point)
{
return (point.X + ", " + point.Y + ", " + point.Z);
}