Text format problem
Text format problem
(OP)
I was using NX5
In the expressions I had:
HEATER=ug_setPartAttrValue("DESCRIPTION",format("HEATER %.3f dia. x ",p0) + format("%.2f",p1))
p0=heater diameter=.625
p1=heater length=30.0
It was a cylinder representing a tubular heater in a mold.
The part attribute DESCRIPTION would be "HEATER 0.625 dia. X 31.00"
Now in NX8.5 the DESCRIPTION is "HEATER 15.875 X 787.40
The part is in inches but the description is coming out in millimeters.
Is this a bug or am I missing something?
Did they change how format works?
I work around it by: ug_setPartAttrValue("DESCRIPTION",format("HEATER %.3f dia. x ",p0/25.4) + format("%.2f",p1/25.4))
In the expressions I had:
HEATER=ug_setPartAttrValue("DESCRIPTION",format("HEATER %.3f dia. x ",p0) + format("%.2f",p1))
p0=heater diameter=.625
p1=heater length=30.0
It was a cylinder representing a tubular heater in a mold.
The part attribute DESCRIPTION would be "HEATER 0.625 dia. X 31.00"
Now in NX8.5 the DESCRIPTION is "HEATER 15.875 X 787.40
The part is in inches but the description is coming out in millimeters.
Is this a bug or am I missing something?
Did they change how format works?
I work around it by: ug_setPartAttrValue("DESCRIPTION",format("HEATER %.3f dia. x ",p0/25.4) + format("%.2f",p1/25.4))





RE: Text format problem
What part units are used in the file you are placing the note?
www.nxjournaling.com
RE: Text format problem
RE: Text format problem
see attached image
RE: Text format problem
RE: Text format problem
Description = format("HEATER %.3f dia. x ",p0) + format("%.2f",p1)
Then create a part attribute (of type string) and link it to this expression; no need to use ug_setPartAttrValue. It may even solve your problem...
www.nxjournaling.com
RE: Text format problem
CODE
format("HEATER %.3f dia. x ",p0, "units", "in") + format("%.2f",p1, "units", "mm")www.nxjournaling.com
RE: Text format problem
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Text format problem
expression DESCRIPTION=format("HEATER Ø%.3f x ",p0,"UNITS","IN") + format("%.2f",p1,"UNITS","IN")
then linked it in the attributes.
John, not sure what you meant about replacing the format function with the new Attribute Expression functions.
Thank you all.
RE: Text format problem
File -> Properties -> Attributes
...dialog you'll now find an option to create Attributes linked to the value of an Expression, and while in the Expression dialog, you'll find an option to create an Expression linked to the value of either Part or Object expressions. These new routines have replaced the older 'KF' attribute routines (which still work but are no longer found under the f(x) icon). These create actual 'attribute' expressions which will update like any other expression automatically, something which did not always happen immediately when using the older 'KF' attribute functions.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Text format problem