By setting NX customer default Gateway --> Material/Mass, Attribute Units tab, "Mass Unit: [g], mass" to be displayed in NX, the system attribute MassPropMass, will show a value in grams.
However, if MassPropMass is mapped to Teamcenter using the hard coded system attribute NX_Mass, the displayed value in TC will be in the SI unit kilograms, [kg].
How to get a TC property to reflect the mass in grams?
The behavior where masspropmass/NX_Mass system attribute uses the SI unit kilograms [kg] for mass when being mapped from NX to Teamcenter is the intended behavior. The customer default setting for Mass Properties Units only controls how those properties/attributes a displayed internally in NX.
One way to get mass value in grams [g] would be to create a unitless attribute of data type number, referencing NX_Mass through expressions. Make sure it get the numeric value reflecting grams [g] unit value. And map this attribute to Teamcenter.
If needed, such an attribute can be pre-configured in modeling template part file(-s).
Here is a step by step on how to go about doing this.
- In Teamcenter BMIDE, define a property under the desired ItemRevision in your data model, which later is used for mapping purposes.
- Define an attribute mapping of this TC property. Typically, the attribute mapping string would look like,
"Mass_g" : ItemRevision.gt4_mass_in_gram /master=cad /description="mass from cad"
- Start NX from TC, create a new part, create a solid body in it, make sure Save Option "Generate Mass Data" is enabled, save the new part.
- If we now look in File --> Properties it looks like,
NX have calculated the mass to ~8313g and stored it under the system attribute MassPropMass. Our custom attribute with the display name "Mass [g]" exists but have no value
- Select attribute "Mass [g]"
- Check "Expression Formula"
- In the Expression Formula field drop down, select Reference --> Part Attribute
- Select MassPropMass as the attribute to reference
- Press <OK>
- Click on "Add New Attribute From Template" button, (down right), to finalize.
Our custom attribute is now associated to NX_Mass
However, the value reflects the mass in kilogram.
We now need to modify the Expression accordingly.
- With "Mass [g]" attribute selected, go to Expression Formula field drop down, select Formula.
- Add *1000 after NX_Mass in the Formula field.
- Press <OK> to finalize expression modification
- Press "Accept Edit" in Properties menu to finalize the attribute update
Now "Mass [g]" attribute reflects the mass value in grams
- <OK> on the Properties menu and save the part
Now the TC property have been updated and can be viewed in TC
To get this into a NX model template, open the template part file, add a dummy solid body to use while going through the process described above. When done, delete the dummy solid body and save the model template part file.
Notes