Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IFRs on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

format()

Status
Not open for further replies.

bbylls

Mechanical
Feb 11, 2011
163
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.
 
Replies continue below

Recommended for you

Generally speaking the Expression system honors formatting statements based on standard 'C' string formatting statements, but not necessarily all of them.

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 [highlight #FCE94F][?][/highlight] 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.
 
What version of NX are you running?

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.
 
 http://files.engineering.com/getfile.aspx?folder=fa5898f3-8004-4608-b8a0-b6974a71f671&file=String_Expression_format_statemetns.docx
I'll bet you're running NX 8.0 or NX 8.5, correct?

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor