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


IPolygon4.InteriorRingBag Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

IPolygon4.InteriorRingBag Property

Creates and returns a geometry bag that contains references to all rings that are interior to the specified exterior ring.

[Visual Basic .NET]
Public Function get_InteriorRingBag ( _
    ByVal exteriorRing As IRing _
) As IGeometryBag
[C#]
public IGeometryBag get_InteriorRingBag (
    IRing exteriorRing
);
[C++]
HRESULT get_InteriorRingBag(
  IRing* exteriorRing,
  IGeometryBag** ringBag
);
[C++]

Parameters exteriorRing
exteriorRing is a parameter of type IRing ringBag [out, retval]
ringBag is a parameter of type IGeometryBag

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
[C#]

        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);

        }

See Also

IPolygon4 Interface