Mass as a custom property

Mass as a custom property

chorch123
Enthusiast Enthusiast
3,735 Views
2 Replies
Message 1 of 3

Mass as a custom property

chorch123
Enthusiast
Enthusiast

Hello,

I know this is an ancient topic but I have been unable to find a suitable answer.

My problem is that I need to show the physical property Mass in my Vault Basic.

The only way I know to do this is to create a custom property that I could import later in Vault.

When trying to create "Weight" (in order not to have the same name) as a custom property of the physical property Mass I find some inconveniences:

- There is too much precision, I have 6 decimal numbers after the point.

- The result is in gramms

I define Custom property, as a text property, =<Mass> kg

So, is there any way that I can obtain this property as:

0.4 kg                    instead of

432.562014 kg       ?

Thank you very much in advanced

 

0 Likes
Accepted solutions (1)
3,736 Views
2 Replies
Replies (2)
Message 2 of 3

chorch123
Enthusiast
Enthusiast

Hello again,

I had forgotten that I need to do this for .ipt and .iam.

For parts I can create the custom property, despite its customization, but I have no idea how to do it with an assembly, because Inventor doesn't recognise <Mass> as property.

Thanks again

Jorge

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Not really sure if this will help you but I have this piece of code which changes the amount of decimal places based on the total weight.

Dim mass As Decimal 
mass = iProperties.Mass

Dim massString As String


Select Case mass
	Case < 1 
	massString = CStr(Round(mass, 2, MidpointRounding.AwayFromZero))& " kg"
	Case 1 To 10 
	massString = CStr(Round(mass, 1, MidpointRounding.AwayFromZero))& " kg"
	Case > 10 
	massString = CStr(Round(mass, 0, MidpointRounding.AwayFromZero))& " kg"
End Select 

iProperties.Value("Custom", "Mymass")= massString

 I can then populate the drawing border with the custom property. Works in part and assembly files also.