ILoveMadoka Posted April 8, 2010 Posted April 8, 2010 One of the lisp gods here (alanjt) wrote this for me relatively recently and I was wondering if/how it could be modified to change the DIMASZ value to 1/2 of the current DIMSCALE. Is it a good starting point or would I need a routine from scratch? (DIMASZ controls the length of the jog in Ordinate dimensions for anyone who does not know that already...) I know a tiny little bit of autolisp but I know squat about VL. Here is the code: (reformatted!) (defun c:MO (/ #SS) (cond ((setq #SS (ssget "_:L" '((0 . "DIMENSION")))) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for x (setq #SS (vla-get-activeselectionset *AcadDoc*)) [i];;I'm guessing I'd have to modify this somehow..[/i] (vl-catch-all-apply 'vla-put-centertype (list x acCenterNone)) ) ;_ vlax-for (vl-catch-all-apply 'vla-delete (list #SS)) ) ) ;_ cond (princ) ) ;_ defun I'm looking for two different flavors of this.. (I'll ask up front rather than ask after the fact!) 1) Change DIMASZ to 1/2 of Current DIMASZ value. 2) Enter a value for DIMASZ to change the selected dimensions to. The default could be 1/2 the dimscale unless a value is entered. I'm guessing anyway.. -- Thank you guys for everything and for sharing your knowledge and coding for the less fortunate!! ps: here is the original thread... http://www.cadtutor.net/forum/showthread.php?t=45363 Quote
Lee Mac Posted April 8, 2010 Posted April 8, 2010 Looks like one of Alan's This makes it easier for us to read it Quote
alanjt Posted April 13, 2010 Posted April 13, 2010 (defun c:MO (/ ss size) (cond ((and (setq ss (ssget "_:L" '((0 . "DIMENSION")))) (setq size (cond ((getdist (strcat "Specify arrowhead size or half of DimScale <" (vl-princ-to-string (/ (getvar 'dimscale) 2.)) ">: " ) ) ) ((/ (getvar 'dimscale) 2.)) ) ) ) (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for x (setq ss (vla-get-activeselectionset *AcadDoc*)) (vl-catch-all-apply (function vla-put-centertype) (list x acCenterNone)) (vl-catch-all-apply (function vla-put-arrowheadsize) (list x size)) ) (vl-catch-all-apply 'vla-delete (list ss)) ) ) (princ) ) Quote
ILoveMadoka Posted April 13, 2010 Author Posted April 13, 2010 Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! This is exactly what I asked for!! I did make one mistake in my description... I had to change: ) ((/ (getvar 'dimscale) 2.)) ) to ) ((/ (getvar 'dimasz) 2.)) ) But that was totally my fault in asking for the wrong thing..!! I cannot thank you enough! You guys are all so awesome! Quote
alanjt Posted April 13, 2010 Posted April 13, 2010 You're welcome. I had wondered about that, but I figured you knew something I didn't. (getvar 'dimscale) is in there twice, so make sure you change it both times. Happy CAD'ing. Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! This is exactly what I asked for!! I did make one mistake in my description... I had to change: ) ((/ (getvar 'dimscale) 2.)) ) to ) ((/ (getvar 'dimasz) 2.)) ) But that was totally my fault in asking for the wrong thing..!! I cannot thank you enough! You guys are all so awesome! 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.