Is it possible to have a macro reverse the path direction of an object? I know there is a way to do it in Shape Edit mode but would like to flip arrow ends quickly with one click.
I tried recording the function but not luck.
you can look at samples from help file :o)
Sub CurveReverse() Dim s As Shape Set s = ActiveLayer.CreateLineSegment(0, 0, 5, 5) s.Outline.StartArrow = ArrowHeads(3) ActiveWindow.ActiveView.Zoom = 200 s.Curve.ReverseDirectionEnd Sub
Sub Test2() Dim sr As New ShapeRange Dim s As Shape Dim n As Long For n = 1 To 10 sr.Add ActiveLayer.CreateLineSegment(0, n / 2, 5, n / 2) Next n Set s = sr.Combine s.Outline.EndArrow = ArrowHeads(2) s.Curve.SubPaths(3).ReverseDirection
thank you Mek.
I'm not quite following. this code creates lines and then reverses direction. I already have a line selected but just need the end arrow reversed.
Yes, it's not code tosolve your request. Code shows a way
With active selected curve
s.Curve.ReverseDirection
Let's try this.
Sub CurveReverse() Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange OrigSelection(1).Curve.ReverseDirectionEnd Sub
this works for me. Thank you again Mek.
You are welcome.