Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp routine for rotating lines

2 REPLIES 2
Reply
Message 1 of 3
g.johnston222
524 Views, 2 Replies

Lisp routine for rotating lines

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.

2 REPLIES 2
Message 2 of 3
3wood
in reply to: g.johnston222

Very good idea.

Message 3 of 3
Kent1Cooper
in reply to: g.johnston222


@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.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost