×
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

Expression Formula frustration

Expression Formula frustration

Expression Formula frustration

(OP)
Ok, to some this is going to seem simple but its driving me nuts... (Yeah it was a short drive)

I am trying to simply do this in NX 7.5.

if diameter = ....then.... sta =
16.0 - 23.99 ....then.... 0.50
24.0 - 29.99 ....then.... 0.75
30.0 - 35.99 ....then.... 1.00
36.0 - 41.99 ....then.... 1.50
42.0 - 47.99 ....then.... 2.00
48.0 - 53.99 ....then.... 2.50
54.0 - 61.99 ....then.... 3.75


Help Help me Ronda!! winky smile

RE: Expression Formula frustration

For the formula on your sta expression, in the extended text entry you should be able to copy/paste this and it should work (tested on 8.0.3.4 - assuming it will work on 7.5). Modify the zeros to whatever you want the value to be if it doesn't fall in any of those ranges.

If ( diameter<16 )
Then ( 0 )
Else If ( diameter<24 )
Then ( .5 )
Else If ( diameter<30 )
Then ( .75 )
Else If ( diameter<36 )
Then ( 1 )
Else If ( diameter<42 )
Then ( 1.5 )
Else If ( diameter<48 )
Then ( 2 )
Else If ( diameter<54 )
Then ( 2.5 )
Else If ( diameter<62 )
Then ( 3.75 )
Else ( 0 )

Daniel Sikes
Design Engineer
Young Touchstone
NX 8.0.3.4

RE: Expression Formula frustration

(OP)
Ahh ok. I had something similar but kept getting 0 (else). I added "in" after the diameter value because it is inches. Now its working! Thanks! I just needed someone to help me know I wasn't losing my mind.

RE: Expression Formula frustration

If you wish to mix units in a single expression, when you enter the number that you wish to be evaluated different than the units for that expression, just include the units inside of closed brackets. For example, lets say I'm creating an expression that is being defined in millimeters but I've got a value that the system needs to consider it as being in inches, such as 'X = 26 + 17[in]', which would come-out as 457.8 millimeters (26 + 17*25.4). And it isn't limited to just mixing Imperial and Metric units. You could also do something like this, 'Y = 12[ft] + 14[mi]', where the result is 887,184 inches.

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: Expression Formula frustration

(OP)
Awesome thanks John!

Do you know if I can add this value to a dimension's actual tolerance instead of using a note to display the value?

RE: Expression Formula frustration

While you can replace the basic value of a dimension with a link to an expression or attribute, you can't access the tolerance values to do the same thing. About the closet that you can come is if rather than using bilateral tolerance call-outs, you used a one or two line 'Limit' type tolerance scheme. The only other approach would be create just a basic dimension and using appended text create the bilateral tolerances. That way you could now control the values displayed using expressions or attributes. Of course, you'd need to know how to properly format a note so that it looked like a bilateral tolerance, which is what's shown below:



In this case the text string in the editor, which you would enter as 'Appended Text', would be: <T+<X1.3@tol>!-0.005> where 'tol' is the expression whose value is .002 and where the '1.3' is controlling the formatting of the numerical value, with the '1' indicating a leading zero (an 0 would have excluded the leading zero) and the '3' is controlling the number of decimal places.

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: Expression Formula frustration

I need the tolerances of my PMI Dimensions to flow properly to other tools such as the VSA Teamcenter Tolerance stackup Analysis tool, so I am assuming appended text will not do the trick. Also, it is a table driven part with certain versions requiring different tolerances. So there is no sophisticated way to link a tolerance to an expression in my table and have this update accordingly for each part?

Daniel Flora

RE: Expression Formula frustration

Are you talking about a tolerance value, as ENTERED on a Drwaing, 'driving' the table? Or are you asking for changes going in the other direction, that is changing a value in a table updating the tolerance value as seen on the Drawing?

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: Expression Formula frustration

I am hoping to put tolerance values in the part family spreadsheet so that I can generate multiple models with varying tolerances and those tolerances will properly update on the model. I am not concerned with the drawing at this time, just the model. I am incorporating tolerances into the PMI Dimension objects.

RE: Expression Formula frustration

Whether it's on a Drawing or using PMI, the issues are exactly the same since the code is basically the same, only the manner in which the items are presented is different.

Note that there is nothing preventing you from creating a series of expressions in your Part Family model which represents that various tolerance values that you would like to eventually use in either a PMI or Drawing Dimension 'appended text' or inclustion in some table, just that you'd have to create the so-called 'tolerance' block using the techniques described earlier in this thread.

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: Expression Formula frustration

The issue is a so-called "tolerance" that exists as an appended note to the dimension is not going to be recognized as a parameterized tolerance value and used for evaluation in tolerance analysis tools.

RE: Expression Formula frustration

That is true. If that is what's needed than I guess, without resorting to using NX Open tools, such as Knowledge Fusion, there is no way to link an actual tolerance value, as shown in a Dimension, to the value of an Expression.

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