Registered forum members do not see this ad.
am having trouble writing a macro for the alignment of text to an existing line orientation, has anyone already done this by any chance?
Your profile states that you are using LT; therefore I have to presume that you are talking about a macro for a toolbar button. I’m really not sure if you can achieve that – it is supposed to require a kind of calculation of the base line orientation, which I really don’t see how can be done in button’s macro without AutoLISP support.
Regards,
Mircea
AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3
What is wrong with ALIGN command?
Last edited by Blackfish; 31st May 2012 at 06:58 pm.
LT is still AutoCAD
If you don't mind an interactive solution, then may check if this is useful to you.
Regards,
Mircea
AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3




Not sure if this works in LT UCS OB pick line do text UCS W make sure ortho is on. this will allow text at 0 90 etc to line. You can add a button or menu or macro to do UCS OB
A man who never made mistakes never made anything
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
BIGAL, thank you for the great idea: UCS OB! I didn't know how to get an angle from single-line text, because there is only one insertion point, and with Diesel and macro you are very limited, but as always we should try...
I did it the other way, because I don't understand what do you mean by 'do text UCS W'. Would be nice to just select line instead of picking two points, but I have no idea how to improve the below code.
So, I did.
Maybe something could be better but as a start I'm quite happyCode:^C^C_ucs;n;ob;\^C^C_move;@;;0,0;\^C^C_rotate;p;;@;\^C^C_ucs;p;
PS. Almost as usually no OP's cooperation![]()
Last edited by Blackfish; 4th Jun 2012 at 06:31 pm. Reason: better revised code
LT is still AutoCAD




Registered forum members do not see this ad.
I thought you were trying to add text but to an existing line for orientation rather than alter existing.
Any way the Ucs W, User Co-ordinate System WORLD, mosts times when you start a dwg you are in the "world" setting, if you crash your macro you may need UCS W but UCS P "previous" is a good way to go if your playing with different ucs's. Also another quickie for lots of text "UCS Ob plan" pick all text use "modify" set angle to 0 then "UCS P plan" bit quicker maybe than typing 47d23'35" after you have found out the correct angle.
A man who never made mistakes never made anything
Bookmarks