matloft Posted May 31, 2012 Posted May 31, 2012 am having trouble writing a macro for the alignment of text to an existing line orientation, has anyone already done this by any chance? Quote
Blackfish Posted May 31, 2012 Posted May 31, 2012 am having trouble writing a macro for the alignment of text to an existing line orientation, has anyone already done this by any chance? Can you post whatever you have written? There are guys they cannot resist to help you, but any initial effort's appreciated. Quote
MSasu Posted May 31, 2012 Posted May 31, 2012 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. Quote
Blackfish Posted May 31, 2012 Posted May 31, 2012 (edited) What is wrong with ALIGN command? Edited May 31, 2012 by Blackfish Quote
MSasu Posted May 31, 2012 Posted May 31, 2012 If you don't mind an interactive solution, then may check if this is useful to you. Quote
Blackfish Posted May 31, 2012 Posted May 31, 2012 If you don't mind an interactive solution, then may check if this is useful to you. That's interesting, but now you have standard ALIGN command in AutoCAD 2012LT or newer. However with single-line text when justified to left there is no second characteristic point you can select to align to the line... Quote
BIGAL Posted June 1, 2012 Posted June 1, 2012 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 Quote
fuccaro Posted June 1, 2012 Posted June 1, 2012 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 That's fine if the current ucs is W. I think it should return to the previous one, UCS P would be a better choise. Quote
Blackfish Posted June 1, 2012 Posted June 1, 2012 (edited) 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 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. That's fine if the current ucs is W. I think it should return to the previous one, UCS P would be a better choise. So, I did. ^C^C_ucs;n;ob;\^C^C_move;@;;0,0;\^C^C_rotate;p;;@;\^C^C_ucs;p; Maybe something could be better but as a start I'm quite happy PS. Almost as usually no OP's cooperation Edited June 4, 2012 by Blackfish better revised code Quote
BIGAL Posted June 4, 2012 Posted June 4, 2012 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. Quote
matloft Posted June 4, 2012 Author Posted June 4, 2012 (edited) sorry, am not always in the office, been out in the field. I did come up with this but am having trouble trying to align the single line text to a specific orientation of a line, i am not sure where i am going wrong and if i understand this programming at all really, all well, i will keep persisting. here is what i have so far ^C^C_select;\_move;_p;;\\_rotate;_p;;@0,0;_ref;@;\\ Edited June 5, 2012 by SLW210 Added code tags. Quote
Blackfish Posted June 5, 2012 Posted June 5, 2012 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... ^C^C_ucs;n;ob;\^C^C_move;@;;0,0;\^C^C_rotate;p;;@;\^C^C_ucs;p; Try the above code, where I use UCS;OB command. Thank you again BIGAL Quote
matloft Posted June 6, 2012 Author Posted June 6, 2012 whilst this works, i am hoping to achieve a macro that means that i select the text and then select a line, and it orientates itself to that line, whereby i can then add a section where i can rotate it 180 from its orientation or I can leave it at its current orientation. Quote
Blackfish Posted June 6, 2012 Posted June 6, 2012 All the best and good luck! And post what you achieved one day Quote
Blackfish Posted June 7, 2012 Posted June 7, 2012 whilst this works, i am hoping to achieve a macro that means that i select the text and then select a line, and it orientates itself to that line, whereby i can then add a section where i can rotate it 180 from its orientation or I can leave it at its current orientation. I've just read your coment again and noyiced that my script does exactly what you want in three mouse clicks: select a text select a line select a rotation of the text and you don't need any additional option to rotate the text 180 degrees or not; it's done in the third click PS. It looks like you could have one click less, but you actually need to it to decide about leaving the text or rotating 180 degrees. It's exactly what you need Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.