Previous Document Next Document

Object Model Reference : Classes : N : Node : Properties : Node.SubPathIndex


Node.SubPathIndex

Property SubPathIndex As Long

Description

Member of Node

The SubPathIndex property returns the index number of a subpath within the Curve.Subpaths collection.

The SubPathIndex property returns a read-only value.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.