×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

format()

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.

RE: format()

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 [?] 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()

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources