format()
format()
(OP)
I am looking for information an the format() syntax that can be used in expressions.
I have used ug_setPartAttrValue("DESCRIPTION",format("BAR %3f dia. x ",p0) + format("%.2f",p1))
This gives me a bar diameter of 3 decimal places based on the value of p0 and the length based on the value of p1.
I imagine this can be used in many other ways, maybe as a text substitute, extract, replace, etc?
Did a search in the help file and found nothing.
I am using NX8.
Maybe one of the hidden secrets.
Thank you.
I have used ug_setPartAttrValue("DESCRIPTION",format("BAR %3f dia. x ",p0) + format("%.2f",p1))
This gives me a bar diameter of 3 decimal places based on the value of p0 and the length based on the value of p1.
I imagine this can be used in many other ways, maybe as a text substitute, extract, replace, etc?
Did a search in the help file and found nothing.
I am using NX8.
Maybe one of the hidden secrets.
Thank you.





RE: format()
The best NX source for help with this is go to the Expression dialog, select the function icon f(x) in the lower left of the dialog, go to the 'String' category and select the 'format' item. Now press the 'Help' icon [?] on the right side of the dialog and you will get a page from the NX Help document showing the supported formatting schemes.
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: format()
RE: format()
But just in case you can't find it, I've attached an MS Word file which shows the content of that help page.
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: format()
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.