API Documentation > CorelDRAW > 2025-v26 > SegmentRange > IVGSegmentRange
SegmentRange.Length property
Gets the total length of the segments within the range
Syntax:
Property Get Length() As Double
Remarks:
The Length property returns the total length, in document units, of all segments in a segment range.
Examples:
The following VBA example displays the total length of all curve segments in the selected curve.
Sub Test()
Dim sgr As New SegmentRange
Dim seg As Segment
For Each seg In ActiveShape.Curve.Segments
  If seg.Type = cdrCurveSegment Then sgr.Add seg
  Next seg
  MsgBox "All curve segments have total length of " & sgr.Length & """"

End Sub