Jump to content

Change DimStyle Precision in Multiple Drawings


ASQ

Recommended Posts

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 

Screenshot_4.png

Link to comment
Share on other sites

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 

Screenshot_4.png

@ASQ, Maybe it can be done by ODBX, please upload at least 3 samples.dwg

 

  • Like 2
Link to comment
Share on other sites

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 by Steven P
Link to comment
Share on other sites

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 

Screenshot_4.png

@ASQ, Maybe it can be done by ODBX, please upload at least 3 samples.dwg

 

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...