Round decimal precision

Round decimal precision

M_Santi
Enthusiast Enthusiast
489 Views
4 Replies
Message 1 of 5

Round decimal precision

M_Santi
Enthusiast
Enthusiast

So I'm trying to round the decimal places to 3 places of my custom Iproperties on my drawing.

I first created my parameters of the Area and Mass that I can manually type and not linked to any part model or assemblies.

 

Mikail_Santi_1-1674761097624.png

 

Then I created a rule of having my custom Iproperties for area and mass to = the value of the parameters.

 

Mikail_Santi_2-1674761118279.png

My main problem is that I can't set the decimal places to 3 places. I would be getting different kinds of decimal places? Is there a way for me to set the decimal places to only 3? I also want to remove the leading 0.

Mikail_Santi_3-1674761277147.png

 

 

 

0 Likes
Accepted solutions (1)
490 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Try this:

WCrihfield_0-1674762235087.png 

WCrihfield_1-1674762318542.png

 

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

M_Santi
Enthusiast
Enthusiast

Are the parameters linked to a model because mine are not. I do not want my parameters to be linked to a model since I will be using the template with different models every time.

0 Likes
Message 4 of 5

M_Santi
Enthusiast
Enthusiast
Accepted solution
I found out how to do it myself, now I just need to find away to remove the leading zero.
This is the rule I used:
iProperties.Value("Custom", "Mass") = Round(MASS, 3)
0 Likes
Message 5 of 5

WCrihfield
Mentor
Mentor

The images I posted were of the Parameters dialog within a part, so those parameters were for that part only, and not linked to any other model or Excel file.  However, if you want to use these values in a drawing, without pointing to any 'model', then you would have to do the same thing within the Parameters dialog of the drawing.  What this is doing is:  When you check the checkbox under 'Export Parameter' column, that automatically creates a matching custom iProperty that mirrors this parameter.  Then once that checkbox is checked, you can right-click on that row (for that parameter), and choose Custom Property Format, which will bring up that dialog, allowing you to customize the formatting and precision of the custom iProperty that it creates.  That custom iProperty will remain up-to-date to the parameter when it is created this way.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes