Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Expressions NX9: "IF" statements

Status
Not open for further replies.

3dr

Automotive
Jul 10, 2004
451
I'm successfully using these to develop smart models that can be globally morphed. Typically commercial hardware that comes in a family of different sizes. But when I use conditional "if" statements I'm only able to look at a numeric expression. I would like to be able to look at more than just that. Is it possible to use an expression like "Y" "N" or an alphanumeric like "LJ.750" ???

I'm sure this is basic stuff for many of you... can you help the newb???

TIA

Dave
 
Replies continue below

Recommended for you

Ok John,
I think I can answer my own question and say no to the above question.

From the reading I did over the weekend it looks as if I may need to use KRX files to get that type of control.

Am I barking up the right tree???

Dave
 
You're correct, there is no way to dynamically alter the scope of one set of input options based on the setting of another, at least not using the Attribute approach, however, the KRX files does provide that capabilities and is this is truly a family table application that that would be the way to go. What I've been showing you are approaches that work well when your workflow is template-model based. That is, you have a predefined template part that you open, rename and then chose the parameters desired for the new part that you're creating. This approach is useful when there's a certain based model which can be controlled by the attributes/expressions, but which then needs additional custom work and features before it's finished, whereas Family Table parts are only practical when you can fully define the desired model using either the old FamilY Table dialog interface or the newer KRX-based interface.

Anyway, I've tried to provide you with a better idea of the Attribute and Expression options that NX now has (starting with NX 8.0) as this will provide you with a more complete set of tools going forward. Have fun...

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.
 
Will do. You've brought me a long way John thanks.
The last example is something I'm going to attempt to build on rather than delve into yet deeper water with KRX. I do actually have to get things done sooner or later!
I'll just have to put a limit on how much expand-ability to offer without being able to dynamically alter the select able options.

I'm thinking I may try to activate a suppressed feature like a "box" when a bad combination of tonnage and stroke is used. And I do have the caveats listed in the Stroke attribute.

All good. Have a great holiday.

Dave
 
Happy New Year John!
I'm having a units problem with the "list expression" that I can't seem to pin down. (See Attached expression list)

Expressions BODY_Length & STROKE come out 25.4 times longer than they should while DIA_Body & DIA_Piston are working as designed.

I used your "Expression_List_Example_for_3dr" as the foundation for everything and it has worked beautifully other than this quirk. Which I've been able to compensate for with a multiplier.

I've realized that I can just switch the units of the expression and not need to use that on everything the way I have. But I don't want to go back and rework any of it till I figure this piece out. It's been vexing me for days.

Can you point me in the right direction??

TIA

Dave
 
 http://files.engineering.com/getfile.aspx?folder=640f683d-07ed-4172-babb-642a7816fdde&file=SLN_-_XXX.exp
Without going through all your expressions, there is one thing to keep in mind. When either setting an Attribute equal to the value of an Expression or when setting the value of an Expression to that of an Attribute, you do NOT need to use the same units at both ends of the link. In other words, you can pass a Number Attribute defined as a Lenght in Imperial units, such as in inches, to a Length Expression that is defined in mm's and the system will do the conversion for you automatically. This also works going the other way, where you can create Attributes which are extracting numerical values of Expressions and again converting the units for you. This can be handy where you might have a pair of Attributes reporting the value of the same Expression, one in Imperial units and the other in Metric, which might be useful if there was a need to place these values as notes on a Drawing or something. This is a lot more elegant then messing up the Expression list with a bunch of conversion expressions there only to get two sets of values for linking to a document or some other referenced item.

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