ASQ Posted August 3, 2023 Posted August 3, 2023 Hi guys, im looking for a quick way for change the dimension precision in multiple files. I need to change from 0.000 to 0.00 in multiple files. I dont want open each drawing and set the precision to 2 decimal. You know we look for the quick and less bored way of do things.  Thanks Quote
devitg Posted August 3, 2023 Posted August 3, 2023 6 hours ago, ASQ said: Hi guys, im looking for a quick way for change the dimension precision in multiple files. I need to change from 0.000 to 0.00 in multiple files. I dont want open each drawing and set the precision to 2 decimal. You know we look for the quick and less bored way of do things.  Thanks @ASQ, Maybe it can be done by ODBX, please upload at least 3 samples.dwg  2 Quote
Steven P Posted August 4, 2023 Posted August 4, 2023 (edited) Without testing this, no error checking and taken from something else, should change the dimension style "Standard" to 2 decimal places - amend the code to suit  Just need to apply it to your preferred batch method changing all the drawings (see scriptpro or Lee Macs script editor, or the core console)  (defun c:dimDPs ( / Precision DimStyleName ) (setq DimStyleName "Standard") ; Change Standard to your required dimension (setq Precision 2) ; Decimal places (setvar "DIMADEC" Precision) ;angular precision (setvar "DIMALTD" Precision) ;alternative units precision (setvar "DIMDEC" Precision) ;dimension precision (setq dimstylelist (tableSearch "dimstyle")) ; get list of dimstyles in drawing (if (= (member DimStyleName dimstylelist) nil) ; if dimstyle doesn't exist (command "dimstyle" "s" DimStyleName) (command "dimstyle" "s" DimStyleName "Y") ) ; end if (princ) )  Edited August 4, 2023 by Steven P Quote
devitg Posted August 4, 2023 Posted August 4, 2023 22 hours ago, ASQ said: Hi guys, im looking for a quick way for change the dimension precision in multiple files. I need to change from 0.000 to 0.00 in multiple files. I dont want open each drawing and set the precision to 2 decimal. You know we look for the quick and less bored way of do things.  Thanks @ASQ, Maybe it can be done by ODBX, please upload at least 3 samples.dwg  Quote
BIGAL Posted August 5, 2023 Posted August 5, 2023 Steven PÂ Â (tblsearch "dimstyle" "TA-DIM-50") your missing style name. Â 1 Quote
BIGAL Posted August 5, 2023 Posted August 5, 2023 I am not sure that changing the dimstyle will change the dim text. You may need to change each existing dim, new dims will use the 2 decs. Â (setq obj (vlax-ename->vla-object (car (entsel "Pick dim obj")))) (vlax-put obj 'PrimaryUnitsPrecision 2) Â Quote
Steven P Posted August 5, 2023 Posted August 5, 2023 It does in the LISP I copied this from - though of course I might have missed something. Perhaps the best bet is change the dim style so that future dimensions are to 2 places and then change the existing dimensions to ensure they are correct to? Â Once that works OK for one drawing then look at multiple drawings, ODBX Devitg? (putting this link here for my reference for that part: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/odbx-copyobjects-question/td-p/1937998Â - references DimStyles) Â Also thinking might have to avoid VL- functions so that the OP can use the core console if just changing the DimStyle won't work and you need to go through each drawing? 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.