ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / SegmentType Enumeration
Example Example

In This Topic
    SegmentType Enumeration
    In This Topic
    Describes the type of line segment. See the Segment.SegmentType property.
    Syntax
    Members
    MemberDescription
    Bezier A third degree cubic Bezier curve. A non-linear segment defined by four control points. The Bezier curve starts at control point 0 (start point) and ends at control point 3 (end point) The start point and control point 1 define the tangent at the start point. Control point 2 and the end point define the tangent at the end point. The length of these tangent lines and position of the 4 control points determines the shape of the created Bezier curve.
    EllipticArc An elliptic arc is the portion of the boundary of a 2D ellipse that connects two points.
    Line A straight line segment between a start point and end point.
    Example
    Enumerate the parts of a Polyline
    ReadOnlyPartCollection polylineParts = polyline.Parts;
    
    // enumerate the segments to get the length
    double len = 0;
    IEnumerator<ReadOnlySegmentCollection> segments = polylineParts.GetEnumerator();
    while (segments.MoveNext())
    {
      ReadOnlySegmentCollection seg = segments.Current;
      foreach (Segment s in seg)
      {
        len += s.Length;
    
        // perhaps do something specific per segment type
        switch (s.SegmentType)
        {
          case SegmentType.Line:
            break;
          case SegmentType.Bezier:
            break;
          case SegmentType.EllipticArc:
            break;
        }
      }
    }
    
    // or use foreach pattern
    foreach (var part in polyline.Parts)
    {
      foreach (var segment in part)
      {
        len += segment.Length;
    
        // perhaps do something specific per segment type
        switch (segment.SegmentType)
        {
          case SegmentType.Line:
            break;
          case SegmentType.Bezier:
            break;
          case SegmentType.EllipticArc:
            break;
        }
      }
    }
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             ArcGIS.Core.Geometry.SegmentType

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also