NX8 MASS Attribute best practices
NX8 MASS Attribute best practices
(OP)
In past versions, we had developed a practice of using code like this to set a Part Attribute for MASS (which could be used to link to Drafting drawings, etc):
ug_setPartAttrValue("MASS",format("%.3f",MASS))
In the above, one would create a MASS expression which would be set to the Mass value of a parametric Body Measurement feature.
In NX8, the Attributes functionality seems to have gotten a boost, so that now you can set a Part Attribute directly linked to an Expression (ie: MASS from before).
I'm running into an issue, where the value of this expression gets truncated to an integer value when placed into Drafting. (ie: add a Note, set type to "Relationships", Object Parameters, pick MASS from the part...).
In this example, how do I set the number of significant digits for the note when placed onto the Drafting sheet?
And more generally, what is the best practice for MASS Attributes in NX8? Should we stick with the way things worked before, or is there some better way to handle it given improvements in both the Attributes code and Drafting?
ug_setPartAttrValue("MASS",format("%.3f",MASS))
In the above, one would create a MASS expression which would be set to the Mass value of a parametric Body Measurement feature.
In NX8, the Attributes functionality seems to have gotten a boost, so that now you can set a Part Attribute directly linked to an Expression (ie: MASS from before).
I'm running into an issue, where the value of this expression gets truncated to an integer value when placed into Drafting. (ie: add a Note, set type to "Relationships", Object Parameters, pick MASS from the part...).
In this example, how do I set the number of significant digits for the note when placed onto the Drafting sheet?
And more generally, what is the best practice for MASS Attributes in NX8? Should we stick with the way things worked before, or is there some better way to handle it given improvements in both the Attributes code and Drafting?





RE: NX8 MASS Attribute best practices
<WRef1*0@MASS>
RE: NX8 MASS Attribute best practices
In Drafting, if one adds a Note linked to an Expression (say, "MASS") in the Drafting file, the code looks like this:
<X0.3@MASS>
Where the "0.3" part indicates the number of significant digits. For example, if the value of the NX Expression is:
MASS = 0.123456789 kg
then the above code would result in a Note on the Sheet as follows:
.123
I can't seem to find anywhere in the Siemens documentation that discusses the syntax of this code, but I would like to modify it so that in this example, the result would have a "0" in front of the decimal, like:
0.123
Anyone know how to accomplish that? (The final result would be something like:
MASS: 0.123 KG
and for masses > 1 kg, it would read something like:
MASS: 1.123 KG
Thanks in advance.
RE: NX8 MASS Attribute best practices
In a previous thread (thread561-299440: How to list mass in different unit in the Partslist ?) John Baker discussed the fact that in a future version (guessing NX8?) Weight Management tools would automatically assign Part Attributes, and that accessing these Attributes would not require special characters, like <W$=@MASS>.
I haven't been able to find a good reference for these updates in the NX8 documentation. I'm also not sure if Advanced Assemblies license is required to even access any of the Weight Management tools (assuming it still is). If so then I need to find a best practice which doesn't depend on Advanced Assemblies.
RE: NX8 MASS Attribute best practices
Go to...
Customer Defaults -> Gateway -> Material/Mass -> Attributes
...and check to make sure the various Mass Property Attributes have been toggled ON (they should ON by default).
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
UG/NX Museum: http://www.plmworld.org/p/cm/ld/fid=209
To an Engineer, the glass is twice as big as it needs to be.