K Baden Posted November 9, 2017 Share Posted November 9, 2017 Good morning! I am looking at an old LISP my company has, and it would be very useful, BUT for some reason when it replaces the aligned dimension with a rotated dimension, the new dimension bumps out a bit. Can anyone perhaps take a look and see if there's an easy solution to this issue? I want the new dimension to exactly mimic the previous one's placement, rather than bumping it out. maybe it has to do with the text placement point? not sure. Thanks in advance! (defun dtr (a) (* pi (/ a 180.0))) DTR (defun c:A2R (/ ss Ent EntData Pt1 Pt2 Pt3 ocmd omode olay odim) ; Redraw dimension that were drawn as aligned as rotated on correct layer, and with correct dimension style. (setq ocmd (getvar "cmdecho")) (setvar "cmdecho" 0) (command "_.undo" "_end") (command "_.undo" "_begin") (setq old_omode (getvar "osmode")) (setvar "osmode" 0) (setq olay (getvar "clayer")) (setq odim (getvar "dimstyle")) (if (setq ss (ssget '((0 . "DIMENSION")))) (while (setq Ent (ssname ss 0)) (setq EntData (entget Ent)) (if (not (member '(100 . "AcDbRotatedDimension") EntData)) (progn (setq Pt1 (cdr (assoc 13 EntData))) (setq Pt2 (cdr (assoc 14 EntData))) (setq Pt3 (cdr (assoc 11 EntData))) (if (< (car Pt1) (car Pt2)) (command "_.ucs" "_3" Pt1 Pt2 (polar Pt1 (+ (DTR 90) (angle Pt1 Pt2)) 5 ) ) (command "_.ucs" "_3" Pt2 Pt1 (polar Pt2 (+ (DTR 90) (angle Pt2 Pt1)) 5 ) ) ) (setvar "clayer" (cdr (assoc 8 EntData))) (command "_.dimstyle" "_r" (cdr (assoc 3 EntData))) (entdel Ent) (command "_.dim" "_horizontal" (trans Pt1 0 1) (trans Pt2 0 1) (trans Pt3 0 1 ) "" "_exit" ) (command "_.ucs" "_p") ) ) (ssdel Ent ss) ) ) (command "_.dimstyle" "_r" odim) (command "_.undo" "_end") (setvar "clayer" olay) (setvar "osmode" old_omode) (setvar "cmdecho" ocmd) (princ) ) Quote Link to comment Share on other sites More sharing options...
K Baden Posted November 9, 2017 Author Share Posted November 9, 2017 Perhaps there is a way to keep the text position x and y specifically? this is what changes each time Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted November 10, 2017 Share Posted November 10, 2017 Instead of using group code 11 (midpoint of text) you should use group code 10 (definition point). Quote Link to comment Share on other sites More sharing options...
K Baden Posted November 10, 2017 Author Share Posted November 10, 2017 This is perfect! I tried a few other group codes with no luck. This one is the one i needed. Thanks a ton!! 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.