How to remove trailing zeros in dimension style text fields

How to remove trailing zeros in dimension style text fields

gagnon-vanleeuweo
Participant Participant
6,262 Views
10 Replies
Message 1 of 11

How to remove trailing zeros in dimension style text fields

gagnon-vanleeuweo
Participant
Participant

I've been trying for a while to remove trailing zeros in dialog boxes, because I think it looks cleaner and makes edits easier (no need to select a whole block of zeros before typing a new value). Here is how I did it.

 

My length units are typically set to maximum precision:

Units.jpg

 

Which means that my dialog boxes have tons of trailing zeros:

STDactive.jpg

 

However, create a fractional dimension in the drawing, right click and save it as a new dimension style and...

Saveasnew.jpg

 

There will be no trailing zeros in text fields! You can then set the dimension unit format to whatever you like (decimal with three places for me):

Decimaldim.jpg

 

As long as the "no trailing zeros" dimension style is active, it suppresses trailing zeros in the text formatting bar (except for the slant/spacing/stretch options, but I don't use these often), the multileader style settings and the table style settings:

Textformat.jpg

 

 

I hope somebody finds this helpful. Let me know if there is any downside to doing this (I couldn't find any).

Apologies if this is common knowledge, but I've searched Google and the forums many times without success.

Accepted solutions (1)
6,263 Views
10 Replies
Replies (10)
Message 2 of 11

CodeDing
Advisor
Advisor

@gagnon-vanleeuweo ,

 

It's interesting to see the problems other people have that you never would have guessed existed.

If you could indulge me (and possibly others), can you elaborate as to why you would want to set the MAXIMUM precision in your units, but NOT want to see that precision elsewhere in AutoCAD? Is the maximum necessary?

 

I hope my question does not come off as sarcastic. I genuinely am not sure what the reasoning behind your process is and would like to learn for my knowledge.

 

EDIT:


@gagnon-vanleeuweo wrote:

 I think it looks cleaner and makes edits easier (no need to select a whole block of zeros before typing a new value).


I guess this technically answers my question. Just seems strange to me that you would need that amount of precision in your drawing, but not want to see/use it in your styles also. But perhaps the precision is only needed in one (or a few) part(s) of your drawing and not for your styles.

 

Best,

~DD

0 Likes
Message 3 of 11

ВeekeeCZ
Consultant
Consultant

The number of zeros in DIMs is usually given by precision required in the industry you're working in.

Message 4 of 11

gagnon-vanleeuweo
Participant
Participant

@CodeDing 

 

I make drawings of mechanical parts and I understand "imperfect" dimensions can cause problems with plasma cutters and CNCs if there are open loops or imperceptibly crooked geometry. I often check old drawings which contain subtle mistakes, for example 3-3/8 would be drawn 3.37501455 instead of 3.375.

 

I like to have maximum precision because I use DIST and MEASUREGEOM to check dimensions. If I set a low number of units, I miss these mistakes because these commands return their results using the number of decimal places set in UNITS. Therefore I use the maximum number of places possible, but my dimension style is set to 3 decimals because that's all I need for machining the parts I draw. I guess I could make a separate dimension style with 9 decimal places and measure the geometry using dimensions, but I would have to switch back and forth between them.

 

I'm always looking for ways to streamline my workflow so if you have suggestions I'd love to hear them.

 

 

@ВeekeeCZ 

 

Yes, this is why I limit my dimensions to 3 decimals, but use more decimal places in UNITS to check the drawing geometry.

Message 5 of 11

CodeDing
Advisor
Advisor

@gagnon-vanleeuweo ,

 

Sounds good to me. Thank you for taking the time to explain.

 

Best,

~DD

0 Likes
Message 6 of 11

john.uhden
Mentor
Mentor
Accepted solution

Usually, we convert a REAL into a STR to control its display and often its value moving forward.  For those trailing zeros, check out the DIMZIN dwg variable.

John F. Uhden

Message 7 of 11

gagnon-vanleeuweo
Participant
Participant

@john.uhden 

 

Thanks John. I found out that process described in my first post is equal to DIMZIN = 9.

 

However, I just realized that by enabling "suppress leading zeros" (which changes DIMZIN to 4), the trailing zeros are now displayed in text fields, which renders irrelevant what I was trying to achieve. Oh well.

Message 8 of 11

afereos
Explorer
Explorer

Let me give you an example why one would need a precision greater than the one he wants to show in dimstyles.

 

For example the general use of dimensions in architecture drawings are something like 1.30. We usually want to show meters as units and 2 decimals as centimeters. There are though a few times that you need to show half a centimeter. Not always but rare occasions. So we dont want to have these 3 decimals shown in all the dimensions but just show when this happens. Therefore we set the units to milimeters and use dimension styles to show the dimensions as shown above. This is because we dont want to type comma everytime we want to type units in autocad. 

 

The problem here though is that autocad still cannot suppress a certain number of zeros (like one or two zeros only), it can only suppress all trailing zeros. I hope after years of development someone can add this function finally.

0 Likes
Message 9 of 11

john.uhden
Mentor
Mentor

I don't think it's all that difficult.

With DIMZIN=0 and DIMPREC=3

you should get the same as

(rtos 5.0 2 3)  "5.000"

John F. Uhden

0 Likes
Message 10 of 11

Sea-Haven
Mentor
Mentor

Interesting 30+ year old civil software had that option to pad or not plus precision. 

 

1.5 1 dec no pad

1.50 2 decs plus pad 

1.500 3 decs plus pad

0 Likes
Message 11 of 11

michael_ball
Participant
Participant

THANK YOU.... that has been bugging the f out of me for months.

0 Likes