示例:由线段生成一个环,由环构成一个多边形
Dim pSegColl As ISegmentCollection
Set pSegColl = New IRing
'pSegmentA and pSegmentB are Lines built earlier
pSegColl.AddSegment pSegmentA
pSegColl.AddSegment pSegmentB
Dim pRing As IRing
Set pRing = pSegColl 'QI
pRing.Close
Dim pPolygon As IGeometryCollection
Set pPolygong = New Polygon
pPolygon.AddGeometry pRing