×
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

weight attribute NX6

weight attribute NX6

weight attribute NX6

(OP)
Below is what is the expression to create a weight part attribute. "mass" is equal to the expression from the body measurement feature that is the mass of the solid, in my case, mass=p38

weight_attribute = ug_setPartAttrValue("WEIGHT",format("%0.2f",mass))

In   "%0.2f"
What is the symbol that comes before the zero?
The "2" is the number of decimal places.
What does the "f" refer to?


 

RE: weight attribute NX6

(OP)
I am sorry, the percent sign comes before the zero.
It was not until I posted this that I could see that - In the text editor it looks differnt.

RE: weight attribute NX6

The format() function seems to use C printf formating syntax where f stands for decimal floating point number, Google "printf" for more information.


// Petter
 

RE: weight attribute NX6

Here is a good link you should bookmark:

http://stat.ethz.ch/R-manual/R-patched/library/base/html/sprintf.html

It will show you most all of the so-called 'C-style String Formatting Commands' which is the basis for what we did with the NX Expression system for string formating.  Now I can't guarantee that NX supports ALL of the items that you will find on this webpage, but ALL of the ones we DO support are covered there somewhere.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/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