Hi there,
Is there a way to get the index or some type of identifier of that node while it's selected?For example, I want to have someone click a node and I want to store that index for later use.I thought I could find the index by navigating the shape->subpath->node it was attached to but I can't figure out the correct navigation path to "node.index" directly.For Example,-The user clicks on a node-I want to identify the node by it's index (unless there is a better property to identify it) Dim s As Shape Dim sp As SubPath Dim n As Node Dim NodeIndex as integer 'Here's where I can't get to the index. I thought I could go Selection.shape.subpath.node, but that doesn't work. NodeIndex = activeselection.shapes.xxxxxxx NodeIndex = s.shapes.xxxxxx NodeIndex = sp.nodes.xxxxxxxx Is there a way to do this?Thanks!
No you do not need to do a ForEach loop, you can get the selection which will return a NodeRange. The following with display a message box with the number of nodes selected:
Sub NodeSelection() Dim nr As NodeRange Set nr = ActiveShape.Curve.Selection MsgBox nr.Count End Sub
Hope that helps,
-Shelby