DuanJinHui Posted September 22, 2014 Share Posted September 22, 2014 Hi friend. Need a lisp rotating the text of dimension to Horizontal or vertical. help. Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 22, 2014 Share Posted September 22, 2014 DIMEDIT is built in AutoCAD to rotating the text of dimension to Horizontal or vertical. Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted September 23, 2014 Author Share Posted September 23, 2014 DIMEDIT is built in AutoCAD to rotating the text of dimension to Horizontal or vertical. Yes, 0 , 90,180, 270 degrees is I need. why can't input "0" degrees ? and I don't want input. can dynamic change? Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted September 23, 2014 Author Share Posted September 23, 2014 Can use any "key" to rotating ? between "0, 90, 180, 270 " cycle change. Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted September 23, 2014 Share Posted September 23, 2014 Did you study DIMEDIT very well I think you can find what you looking for. Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 24, 2014 Share Posted September 24, 2014 Yes, 0 , 90,180, 270 degrees is I need. why can't input "0" degrees ? and I don't want input. can dynamic change? here's is my attempt, i hope you don't mind using mouse as key? select dimensions -> [enter] -> [L&R] mouse click to rotate HTH http://www.cadtutor.net/forum/showthread.php?88845-Rotating-the-text-of-dimension (defun c:test (/ *error* ss ang key rot e *degrees*) ;hanhphuc 24/09/2014 (defun *error* (msg) (if (not (wcmatch (strcase msg) "*CANCEL*,*EXIT*")) (princ (strcat "\nError: " msg)) ) ;_ end of if (princ) ) ;_ end of defun (setq *degrees* [color="red"]90.[/color]) ; [color="blue"]<--- try change settings here eg: 30. 45. 90. 180. etc.. [/color] (prompt "\nSelect Dimension, then [ENTER]..") (if (and (not (zerop *degrees*)) (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;_ end of and (setq key t) (setq key nil) ) ;_ end of if (prompt "\nMouse click [L] & [R] to rotate.\n") (while key (if (and (setq key (grread nil 10 0)) (setq rot (eval (cons 'cond (reverse (vl-list* '(t (setq key nil)) (mapcar ''((a b) (list (list 'equal (car key) a) (/ pi (b (/ 180. *degrees*))))) '(3 25) (list + -) ) ;_ end of mapcar ) ;_ end of cons ) ;_ end of reverse ) ;_ end of cons ) ;_ end of eval ) ;_ end of setq ) ;_ end of and (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (setq e (vlax-ename->vla-object e)) (vla-put-textrotation e (+ (vla-get-textrotation e) rot)) ) ;_ end of foreach ) ;_ end of while ) ;_ end of while (princ) ) ;_ end of defun (princ "\nRotate DIMTEXT by mouse click. command: test") Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted September 24, 2014 Author Share Posted September 24, 2014 here's is my attempt, i hope you don't mind using mouse as key? select dimensions -> [enter] -> [L&R] mouse click to rotate HTH I really appreciate the help. I haven't tested the code yet, but as soon as I test I let you know. Quote Link to comment Share on other sites More sharing options...
DuanJinHui Posted September 24, 2014 Author Share Posted September 24, 2014 here's is my attempt, i hope you don't mind using mouse as key? select dimensions -> [enter] -> [L&R] mouse click to rotate HTH Cool! I tested yet .Very good! Admire you! Thans a lot ! hanhphuc Quote Link to comment Share on other sites More sharing options...
nod684 Posted September 25, 2014 Share Posted September 25, 2014 (edited) nice code...hopefully it also works with aligned dimensions. one thing i notice is that it changes the Dimension gap? Edited September 25, 2014 by nod684 Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted September 27, 2014 Share Posted September 27, 2014 (edited) nice code...hopefully it also works with aligned dimensions. one thing i notice is that it changes the Dimension gap? i think the gap is measured text's boundingbox, that's why it changes you guys are welcome, just repay i've learned since active in the forums. Idea was Lee Mac's dynamic oblique text, EDIT: ISO text , credit to Lee http://www.theswamp.org/index.php?topic=37429.0 Edited September 28, 2014 by hanhphuc found the link 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.