Abrasive Posted March 7, 2023 Posted March 7, 2023 Has anyone written a routine to rotate the dimension text by a given degree? I looked but didn't find anything. If the dim text is at 0, I would like to be able to just click on the dim and have the text rotate a given degree. It can ask for a degree or rotate in increments. I'm not sure how to even start... Thanks in advance! Quote
marko_ribar Posted March 7, 2023 Posted March 7, 2023 Look for DXF Group code 50... Usually it's 0.0 radians, but you can (entmod) it... Quote
BIGAL Posted March 7, 2023 Posted March 7, 2023 "rotate in increments" there is various ways to do this, you can read say up and down arrows, press enter goes say 10 deg and so on. Do a google, I think the arrow stuff is by Lee-mac. Quote
Abrasive Posted March 7, 2023 Author Posted March 7, 2023 37 minutes ago, BIGAL said: "rotate in increments" there is various ways to do this, you can read say up and down arrows, press enter goes say 10 deg and so on. Do a google, I think the arrow stuff is by Lee-mac. The more I think about it, If it just asks me for the degree I can enter it. Looking for a shortcut way instead of opening properties panel and editing it. I found these two examples and tried to modify them .... but I broke it....lol https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-put-textrotation-syntax/td-p/1684381 Quote
BIGAL Posted March 10, 2023 Posted March 10, 2023 (edited) Something like this. I did not check if its degrees or radians input that is your homework. (setq obj (vlax-ename->vla-object (car (nentsel "\nPick dimension text ")))) (VLA-PUT-ROTATION OBJ (getreal "\nEnter text angle" )) (command "regen") Edited March 10, 2023 by BIGAL 1 Quote
devitg Posted March 13, 2023 Posted March 13, 2023 On 3/7/2023 at 7:51 PM, Abrasive said: The more I think about it, If it just asks me for the degree I can enter it. Looking for a shortcut way instead of opening properties panel and editing it. I found these two examples and tried to modify them .... but I broke it....lol https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-put-textrotation-syntax/td-p/1684381 Do you mean some like it \ Quote
tombu Posted March 15, 2023 Posted March 15, 2023 Alan J. Thompson (alanjt) lisp allows user to set the rotation of multiple blocks, mtext, multileaders and text to match the angle of any selected (nested allowed) curve (c3d feature lines and alignments, line, arc, ellipse, *polyline, circle, etc.), block/mtext/multileader/text, a zero rotation (relative to current UCS) or a picked/specified angle. For curves with arcs, the angle extraction will be taken at the location on the curve closest to the user's selection on said curve. Rotated objects' angle will be readable, but the user will also be given one last chance to rotate them 90°, 180°, 270°. Also, if the users has the Express Tool acet-sys-shift-down loaded, they will be given the option to hold the shift key down when they select their object for rotation extraction for nested selected, rather than having to switch from primary to nested selection. https://www.theswamp.org/index.php?topic=40450.0 In the attached slight modification of his code I added DIMENSION as a type and duplicated the "AcDbMLeader" cond changing it to "AcDbAlignedDimension" to align Dimension Text, then added HATCH modifying PatternAngle of "AcDbHatch" as well. RotateObjects.LSP 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.