alanjt Posted October 23, 2009 Share Posted October 23, 2009 (edited) A request in another thread made me dig this up and do a little updating. I thought I'd post it for you good people. This will rotate all selected MText, Text, Multileaders and Blocks to match the current UCS (basically, rotates everything to zero). Updated: 05.31.11 ZeroRottaion.LSP Edited May 31, 2011 by alanjt Quote Link to comment Share on other sites More sharing options...
Glen Smith Posted October 23, 2009 Share Posted October 23, 2009 Alan, Cool program, I'm not sure if I understand what it should do. I drew some text at various angles and ran the code which rotated the text to 0 degrees. That makes sense. Then I set a UCS on an angle and tried again, but the text did not rotate. Should the text only rotate to 0 deg in its own plane, or is it supposed to be able to change the plane of the text as well? I guess a diffferent way to ask my question is - is this a 2D or 3D application? Glen Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 23, 2009 Author Share Posted October 23, 2009 Alan, Cool program, I'm not sure if I understand what it should do. I drew some text at various angles and ran the code which rotated the text to 0 degrees. That makes sense. Then I set a UCS on an angle and tried again, but the text did not rotate. Should the text only rotate to 0 deg in its own plane, or is it supposed to be able to change the plane of the text as well? I guess a diffferent way to ask my question is - is this a 2D or 3D application? Glen It's a 2D application. I have very little experience with working in actual 3D. Civil 3D is all 3D models, but for actually display purposes, you just show the plan, profile and cross sections. I'd have to play with it to get it to work with a 3D plane. Quote Link to comment Share on other sites More sharing options...
caddmandew Posted May 26, 2011 Share Posted May 26, 2011 Alan This is exactly what I was looking for. I have tried to create my own, but without success. Would you mind sharing the file? Thanks in advance Jim Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 26, 2011 Author Share Posted May 26, 2011 Alan This is exactly what I was looking for. I have tried to create my own, but without success. Would you mind sharing the file? Thanks in advance Jim Oops, forgot I'd removed it. Code re-posted. Quote Link to comment Share on other sites More sharing options...
caddmandew Posted May 26, 2011 Share Posted May 26, 2011 Thanks and have a great day Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 26, 2011 Author Share Posted May 26, 2011 Thanks and have a great day You're welcome. Come and hang out. Since you have but three posts and they all were made today, I'd welcome you to the forums, but I notice you've been a member for quite some time. Quote Link to comment Share on other sites More sharing options...
Least Posted May 27, 2011 Share Posted May 27, 2011 cheers alan, this will be quite useful. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 27, 2011 Share Posted May 27, 2011 Alan, Nice idea for the program But be careful when the UCS plane is not the same as the WCS plane, since the UCSXDIR System Variable is expressed relative to the WCS plane. An example: The fix, change: (setq xdir (getvar "ucsxdir")) to: (setq xdir (trans (getvar "ucsxdir") 0 (trans '(0. 0. 1.) 1 0 t))) I would also be inclined to bound the UCS Angle to a variable prior to iterating through the SelectionSet to save recalculating the angle each time. Lee Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 31, 2011 Author Share Posted May 31, 2011 Alan, Nice idea for the program But be careful when the UCS plane is not the same as the WCS plane, since the UCSXDIR System Variable is expressed relative to the WCS plane. Yes, I know and I know the fix, but if you had noticed, I hadn't updated this program since late 2009. However, since you pointed this out, I went ahead and gave it a complete overhaul. I even noticed that in April of last year, I had updated my AT:UCSAngle subroutine to work properly. Oh well, I never noticed, but it should be good to go now. Thanks for the nudge to update. Updated in first post. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 31, 2011 Share Posted May 31, 2011 Just making you aware... Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 31, 2011 Author Share Posted May 31, 2011 Just making you aware... appreciated. Quote Link to comment Share on other sites More sharing options...
abra-CAD-abra Posted June 24, 2015 Share Posted June 24, 2015 alanjt et al, I am trying to modify this code to allow for the rotation of block content in MLeaders, however, I cannot find any VLA properties or methods associated with the rotation of block content in a multileader. I am using the following resource as suggested by Lee Mac in another post: C:\Program Files\Common Files\Autodesk Shared\acadauto.chm A really good resource which I never knew existed - Thanks Lee Mac! Cheers, Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 24, 2015 Author Share Posted June 24, 2015 alanjt et al, I am trying to modify this code to allow for the rotation of block content in MLeaders, however, I cannot find any VLA properties or methods associated with the rotation of block content in a multileader. I am using the following resource as suggested by Lee Mac in another post: C:\Program Files\Common Files\Autodesk Shared\acadauto.chm A really good resource which I never knew existed - Thanks Lee Mac! Cheers, If I remember correctly, the rotation property of a block within a MLeader wasn't available. Actually, looking at one in the properties palette now, it's not even available there. I don't use many MLeaders with blocks, but for the few I do, if I do have to rotate them, I just use the rotate command. I didn't code this in because using rotate doesn't really work the same as 'put'ing a rotation, and since you don't really have a rotation to extract to begin with, there isn't much to work with on a reference for your new rotation angle. If I have time, I might dig into it some more. Quote Link to comment Share on other sites More sharing options...
abra-CAD-abra Posted June 25, 2015 Share Posted June 25, 2015 Alan, Thanks for your response and explanation. I had an inkling that this would be a manual task. In any case, a great routine which sits at the forefront of my custom menu. If I could count which lisps are used the most, this would be up there - Top stuff! I also like the AT:UCSAngle function. Cheers, Quote Link to comment Share on other sites More sharing options...
danglar Posted November 19, 2015 Share Posted November 19, 2015 Very good programm! But I have a question. Is it possible to rotate All the entities, as mentioned in a first post, to zero relative to current UCS? Quote Link to comment Share on other sites More sharing options...
funkkybebel Posted November 20, 2015 Share Posted November 20, 2015 I have got used to rotate the cursor (to simulate UCS rotate) with Lee's lisp "CursorRotateV1-0.lsp". I though it would work with that, but no. I have to totate UCS to make it works. Thnak anyway, it's really useful. Quote Link to comment Share on other sites More sharing options...
amb2301 Posted September 21, 2017 Share Posted September 21, 2017 A request in another thread made me dig this up and do a little updating. I thought I'd post it for you good people. This will rotate all selected MText, Text, Multileaders and Blocks to match the current UCS (basically, rotates everything to zero). [ATTACH]15045[/ATTACH] Updated: 05.31.11 Thanks for your lisp alanjit, if possible could you please look on to my request posted(Lisp required to make text rotated to 0 angle & make changes in font style & height)? i need a help in creating a lisp, actually i have drawing with lot (nearly thousands of text to converted in a single drawing file) of text to be converted from different angles to zero angle & also to change its text height & font style as shown in attached .dwg file, Another important thing is i need to remove the / symbol from that text & re-arrange as shown in the attached .dwg file. Kindly look on this & requesting to please provide lisp for this work. Also to remove the text P50/ ,like whatever text starts with P & ends with / to be removed.....is it possible? please help urgent help required. TEXT CONVERTION.dwg Quote Link to comment Share on other sites More sharing options...
nanjac86 Posted October 12, 2017 Share Posted October 12, 2017 Dear alanjt , Works perfect. thank very much. Quote Link to comment Share on other sites More sharing options...
danglar Posted November 23, 2017 Share Posted November 23, 2017 Is it possible to add polylines to set of entities for zero rotation? probably based on this approach? https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/rotate-a-selected-side-of-a-polyline-to-zero-degrees-in-autolisp/m-p/7563715/highlight/false#M361760 now it works only for Blocks ,MTEXTs,*LEADERs and TEXTs. With this addition it can works for polylines too Quote Link to comment Share on other sites More sharing options...
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.