Lt Dan's legs Posted August 4, 2010 Share Posted August 4, 2010 hope you don't mind lee. Look at lee's code and replace the 13th line of lee's code with (subst (cons 1 (strcat s " [" (rtos n 2 3) "]\n" (rtos n 3))) (assoc 1 (entget e)) \n = new line look at (rtos n 2 3) the n after rtos is your measurement which was defined in the 7th line of lee's code see (setq n (distof s))) see below for the number after the n and the last number is how many decimal places you want 1Scientific2Decimal3Engineering4Architectural5Fractional Quote Link to comment Share on other sites More sharing options...
RoguePiper Posted August 4, 2010 Author Share Posted August 4, 2010 Actually got it using the \X, just needed the double \\ in the string. Quote Link to comment Share on other sites More sharing options...
Kerry Brown Posted August 4, 2010 Share Posted August 4, 2010 Personally, in that case, I'd use a dimension Style with the Alternate Units set. ... even if it meant having to change styles programmatically you'd be in front because the dimension would retain it's associativity. An alternative would be to apply dim over-rides to the specific dimensions you wanted to display with the Alternate Dimensions .. again retaining associativity. Another alternative to programming a solution is to dim-override modify one dimension manually ( you'd need linear and aligned) then simply use MatchProperties to apply the settings to other dimensions a piccy: Quote Link to comment Share on other sites More sharing options...
RoguePiper Posted August 4, 2010 Author Share Posted August 4, 2010 The alternate units won't work in this case. The drawing is not to scale and all dimensions are put in with text overrides. I have been able to achieve the results I want with the base that Lee started me on. Quote Link to comment Share on other sites More sharing options...
RoguePiper Posted August 4, 2010 Author Share Posted August 4, 2010 Done. Works like I want it to. (defun c:ImpDim ( / ss ) ;; © Lee Mac 2010 (if (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ( (lambda ( i / e s n ) (while (setq e (ssname ss (setq i (1+ i)))) (if (and (setq s (cdr (assoc 1 (entget e)))) (setq n (/ (distof s) 25.4))) (entupd (cdr (assoc -1 (entmod (subst (cons 1 (strcat s "\\X[" (rtos n 2 3) "\"]")) (assoc 1 (entget e)) (entget e) ) ) ) ) ) ) ) ) -1 ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 4, 2010 Share Posted August 4, 2010 Glad you got it working in the end mate - was working all day so couldn't get back to you sooner. The only thing I would ask is to mark where you modified with your initials or other - this is standard coding practice. 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.