API Documentation > CorelDRAW > 2025-v26 > Node > IVGNode
Node.SubPathIndex property
Gets the index of the node's subpath within the curve
Syntax:
Property Get SubPathIndex() As Long
Remarks:
The SubPathIndex property returns the index number of a subpath within the Curve.Subpaths collection.
Examples:
The following VBA example displays the number of nodes that are selected on a curve and the number of subpaths on which they reside. Before running this macro, you must use the Shape tool to select nodes.
Sub Test()
Dim nr As NodeRange
Dim n As Node
Dim spi As New Collection
Dim Found As Boolean
Dim idx As Variant
If ActiveShape Is Nothing Then
  MsgBox "Nothing is selected."
  Exit Sub
End If
If ActiveShape.Type <> cdrCurveShape Then
  MsgBox "A curve must be selected."
  Exit Sub
End If
Set nr = ActiveShape.Curve.Selection
If nr.Count = 0 Then
  MsgBox "Please use the Shape tool to select several nodes."
  Exit Sub
End If
For i = 1 To nr.Count
  Set n = nr(i)
  Found = False
  For Each idx In spi

 If n.SubPathIndex = idx Then


Found = True


Exit For

 End If
  Next idx
  If Not Found Then spi.Add n.SubPathIndex
  Next i
  MsgBox "Selected " & nr.Count & " node(s) on " & spi.Count & " different subpath(s)"

End Sub