Physical Properties Formatting Output in .IDW

Physical Properties Formatting Output in .IDW

gbradley
Enthusiast Enthusiast
433 Views
3 Replies
Message 1 of 4

Physical Properties Formatting Output in .IDW

gbradley
Enthusiast
Enthusiast

When Displaying the Physical Properties- Model Mass of an object.

How can I Format the result so that it shows:

7,715.0 rather than

7715.0 

How can I adTextFormatting.JPGd the Comma?

0 Likes
434 Views
3 Replies
Replies (3)
Message 2 of 4

johnsonshiue
Community Manager
Community Manager

Hi! Formatting the properties can be tricky. It is because Inventor drawing treats these properties as text. Trying to format a text string in numerical fashion is not straight forward. iLogic rule can help easily.

 

1) Open the part or the assembly and create a parameter called MASS_Value or something.

2) Set the proper unit.

3) Create a simple rule equate the MASS_Value to the physical mass.

4) Go back to the Parameters table and check Export flag for MASS_Value.

5) Right-click on the Expression cell -> Custom Parameter Format -> select the appropriate option.

6) In the drawing text, select the MASS_Value.

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
Message 3 of 4

gbradley
Enthusiast
Enthusiast

I was following along nicely until I got to:

5) Right-click on the Expression cell -> Custom Parameter Format -> select the appropriate option.

I could only find Custom Property Format..., but Format: seems to be grayed out.

CustomPropertyFormat.JPG

0 Likes
Message 4 of 4

johnsonshiue
Community Manager
Community Manager

Hi! I was wrong. The workflow I mentioned does not get you the format you were looking for. I should have been more careful before I provided the solution. Sorry for the confusion!

Here is what you need to do with iLogic. Instead of creating a user parameter to capture the mass, you need to create a Text-based custom iProperty. Then literally copy an paste the following code but replace the PropertyName with the actual custom iProperty name.


iProperties.Value("Custom", "PropertyName") = String.Format("{0:#,##0.00}", iProperties.Mass)

 

It should work. Please let me know if it works for you.

Again, I am sorry for the confusion.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes