Hi.
Can anybody help me out in getting the number of a selected Node??!!
I have been trying to use the Node Index but without success.
Thank you very much.
Shape.Curve.Selection returns a noderange containing the selected nodes.
If you only have one node selected, then you could use:
Shape.Curve.Selection.FirstNode.Index
or
Shape.Curve.Selection.FirstNode.AbsoluteIndex
depending on whether you want the index of the node within the subpath that contains it, or in the curve as a whole.
Thank you for replaying.
You are absolutely right.And was doing this wrong, must understand how this works later.I was trying yo create a macro that changes the first Node.
My code is:
Sub ChangeFirstNode() Dim s As Shape Dim sp As SubPath Set s = ActiveShape Set sp = s.Curve.SubPaths(1) Dim n As Long ' I wanted to pass the Node Index value to a variable' but I get a error "Object doesn't support this property or method" n = s.Selection.FirstNode.Index If sp.Closed Then sp.Nodes(n).BreakApart sp.StartNode.JoinWith sp.EndNode End IfEnd Sub
Changing my code, removing this part: Dim n As Long ' I wanted to pass the Node Index value to a variable' but I get a error "Object doesn't support this property or method" n = s.Selection.FirstNode.Index
And changing this one to:
If sp.Closed Then sp.Nodes(ActiveShape.Curve.Selection.FirstNode.Index).BreakApart sp.StartNode.JoinWith sp.EndNode End If
It works. So, I'm missing something in the code. I'm learning as I go.