briankstan Posted August 6, 2009 Posted August 6, 2009 I searched but didn't find anything. I have a drawing with several different dimension styles that have the alternate units turned on and the are displayed in Millimeters, now the Architect would like them Displayed in Meters. I can't figure out how to change the dimension style with the corrected info. I have to update about 100 drawings with at least 3 dim styles in each drawing. I know I can change it using Dimstyle, but I'd rather automate the process if I can. I need to modify the existing dimstyle without using dim overrides. thanks for your help. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Try this mate: (defun c:alt (/ doc) (vl-load-com) (vlax-for dim (vla-get-Dimstyles (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))) (vla-put-activeDimstyle doc dim) (setvar "DIMALTF" 0.001) (vla-copyfrom dim doc)) (princ)) Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 not sure how to setup this one? loaded it, typed alt but didn't see it do anything. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 not sure how to setup this one? loaded it, typed alt but didn't see it do anything. Check your dim styles. Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 I see it created a few new ones, What I'm looking to do is modify the existing ones to new settings, without having to do each one individually. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 I see it created a few new ones, What I'm looking to do is modify the existing ones to new settings, without having to do each one individually. It shouldn't have created anything Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 sorry, that was from the other lisp, before filling in my layers. what is it suppose to do? Quote
The Buzzard Posted August 6, 2009 Posted August 6, 2009 It shouldn't have created anything I like that Lee. It changed the Alt Units Multiplier. Thats great. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Its supposed to do what you requested it to do... :wink: Changes the Alternative Units Multiplier to 0.001 to convert mm to m. Quote
The Buzzard Posted August 6, 2009 Posted August 6, 2009 Its supposed to do what you requested it to do... :wink: Changes the Alternative Units Multiplier to 0.001 to convert mm to m. Lee, I would assume that only will apply to the current dimstyle? Quote
The Buzzard Posted August 6, 2009 Posted August 6, 2009 I just found out its changing in all dimstyles current or not, Not sure if thats a good idea. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 I just found out its changing in all dimstyles current or not, Not sure if thats a good idea. Well, that is what was requested. :wink: Quote
The Buzzard Posted August 6, 2009 Posted August 6, 2009 Well, that is what was requested. :wink: Ok, But if you were using a drawing with multiple viewports with different scales, You might not want to change all of them. Just a thought. Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 what I have to change in the dimstyle is the following Multiplier for alt untis: 25.4 to .02540 Suffix: from MM to M this sets the dimstyle to display correctly once I save it. is there a way to just change those on specific dim styles? Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 what I have to change in the dimstyle is the following Multiplier for alt untis: 25.4 to .02540 Suffix: from MM to M this sets the dimstyle to display correctly once I save it. is there a way to just change those on specific dim styles? yes, but none of this was specified in the OP... Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 yes, but none of this was specified in the OP... sorry I wasn't very clear in my OP, I can see that it would work, but it seems I would have to manually update the dims, as they don't automatically update when the change is made. Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Try to explain the whole problem next time, but this should sort you: (defun c:alt (/ dimlst doc ss) (vl-load-com) (setq dimlst '("DIM_STYL1" "DIM_STYL2")) ;; Change as necessary (vlax-for dim (vla-get-Dimstyles (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))) (if (vl-position (vla-get-Name dim) dimlst) (progn (vla-put-activeDimstyle doc dim) (setvar "DIMALTF" 0.02540) (setvar "DIMAPOST" "M") (vla-copyfrom dim doc)))) (if (setq ss (ssget "_X" '((0 . "DIMENSION")))) (mapcar 'vla-update (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex ss))))) (princ)) Update list as necessary. 1 Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 Thank you, that works perfect. You are the man Quote
Lee Mac Posted August 6, 2009 Posted August 6, 2009 Thank you, that works perfect. You are the man Haha thanks love da smiley Quote
briankstan Posted August 6, 2009 Author Posted August 6, 2009 sometimes trying to figure out these lisp things I really feel like the computer it really taking to me. but once I get them working, usually with others help it sure is nice. 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.