potrero
Mechanical
- Aug 30, 2007
- 516
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?