Say that I have line drawn at 87 degrees, and I later want it to be at 90 degrees (or 180, 270 or 0). Is there a way to "straighten" the existing line, or must I redraw the line with constraints?
.....I've just thought that I need this a few times a week, so here's two macros to straighten such lines, but don't ask me how to use them, LOL
Sub StraightenLinesH() Dim sh As Shape, a#, x1#, y1#, x2#, y2#, x#, y# On Error Resume Next ActiveDocument.ReferencePoint = cdrCenter ActiveDocument.BeginCommandGroup "Straighten lines horizontally" For Each sh In ActiveSelection.Shapes.FindShapes(, cdrCurveShape) sh.GetPosition x, y With sh.Curve.Nodes .First.GetPosition x1, y1 .Last.GetPosition x2, y2 End With If y1 <> y2 Then If x1 = x2 Then a = -90 _ Else a = CorelScriptTools.AngleConvert(2, 1, _ Atn((y2 - y1) / (x2 - x1))) sh.RotateEx -a, x, y End If Next ActiveDocument.EndCommandGroup End Sub Sub StraightenLinesV() Dim sh As Shape, a#, x1#, y1#, x2#, y2#, x#, y# On Error Resume Next ActiveDocument.ReferencePoint = cdrCenter ActiveDocument.BeginCommandGroup "Straighten lines vertically" For Each sh In ActiveSelection.Shapes.FindShapes(, cdrCurveShape) sh.GetPosition x, y With sh.Curve.Nodes .First.GetPosition x1, y1 .Last.GetPosition x2, y2 End With If x1 <> x2 Then If y1 = y2 Then a = 90 _ Else a = CorelScriptTools.AngleConvert(2, 1, _ Atn((x2 - x1) / (y2 - y1))) sh.RotateEx a, x, y End If Next ActiveDocument.EndCommandGroup End Sub
Thanks. I like simple. I hope your macros help you, too.
Another option is to turn on dynamic guides (alt+shift+d). With a little practice, you can straighten a line to 90 degrees with the nodeedit tool very quickly.
Regards,Hendrik
Thank you, too, Hendrik. There is so much functionality in DRAW that I was certain there was something(s) I was missing in the manner of a simple adjustment in the way I was doing this.
Regards,Mad Dog