I'm wondering if anyone has a LISP routine for rotating lines so that text in linetypes always reads from left to right?
I use the QUERY command to create basemaps and often the lines that are imported read upside down or backwards or however you prefer to look at it. Most often, if I look at the XY coords of these backwards lines, the End X coordinate is of a higher value than the Start X coordinate.
Looking for something that would compare the two X coordinates of a line, do some sort of an IF Start X > End X, and if its true, store the XYZ coords of the Start and End in some variable, and swap them.
@g.johnston222 wrote:I'm wondering if anyone has a LISP routine for rotating lines so that text in linetypes always reads from left to right?
....
The routine here [ReverseDirection.lsp with its RD command] will do that, as well as reverse anything else that's directional, including correctly preserving things that I didn't find other similar routines could do [that's why I built it], such as arc segments and varying width in Polylines.
EDIT: That works by object selection, one at a time for reasons explained in a comment at that link, and reverses anything you select, regardless of which way it goes when you select it. If you want a routine to restrict it to Lines only, and be able to select a bunch at once, and have it reverse each one only if it runs in the wrong direction for text elements to read right, that can certainly be done a lot more simply. There may well be something here already that you'd find with a Search, but if not, it wouldn't be very hard to build.