Hello,
I'm trying to write to write a macro which toggles the node between smooth or cusp.
Below code is intended to work on all selected nodes, but it only works on single node.
Sub toggleCusp_Smooth() Dim s As Shape, n As Node Set s = ActiveShapeFor Each n In s.Curve.Nodes If n.Selected Then If n.Type = cdrCuspNode Then n.Type = cdrSmoothNode ElseIf n.Type = cdrSmoothNode Then n.Type = cdrCuspNode End If End If Next nEnd Sub
Thanks.
Try:
Sub toggleCusp_Smooth() Dim s As Shape, n As Node
Set s = ActiveShape For Each n In s.Curve.Selection If n.Type = cdrCuspNode Then n.Type = cdrSmoothNode ElseIf n.Type = cdrSmoothNode Then n.Type = cdrCuspNode End IfNext nEnd Sub
Thanks a lot.
Works perfectly.
Node selection is lost after the macro runs.How do I retain the selection?Thanks.