ArcGIS Pro 2.6 API Reference Guide
GetAllSegments Method
Example 

ArcGIS.Core.Geometry Namespace > Multipart Class : GetAllSegments Method
The collection of segments. If segments is null, a list will be allocated.
Gets all the segments in this multipart.
Syntax
public void GetAllSegments( 
   ref ICollection<Segment> segments
)
Public Sub GetAllSegments( _
   ByRef segments As ICollection(Of Segment) _
) 

Parameters

segments
The collection of segments. If segments is null, a list will be allocated.
Example
List<Segment> segmentList = new List<Segment>(30);
ICollection<Segment> collection = segmentList;
polygon.GetAllSegments(ref collection);
// segmentList.Count = 4
// segmentList.Capacity = 30

// use the segments to build another polygon
Polygon polygonFromSegments = PolygonBuilder.CreatePolygon(collection);
ICollection<Segment> collection = new List<Segment>();
polyline.GetAllSegments(ref collection);
int numSegments = collection.Count;    // = 10

IList<Segment> iList = collection as IList<Segment>;
for (int i = 0; i < numSegments; i++)
{
  // do something with iList[i]
}

// use the segments to build another polyline
Polyline polylineFromSegments = PolylineBuilder.CreatePolyline(collection);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

Multipart Class
Multipart Members