×
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

Expressions NX9: "IF" statements

Expressions NX9: "IF" statements

Expressions NX9: "IF" statements

(OP)
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

RE: Expressions NX9: "IF" statements

Yes, by using String expressions, you can utilize any non-numerical 'value'. Also, for something like 'Yes' and 'No' situations (I assume that that is what you're trying to do with your "Y" and "N" examples) you can use Booleans instead. For example, in the part file attached below, I've created a couple of different expressions using IF statements to control the diameter and length of the cylindrical body. For the length of the cylinder, I've created a String expression 'Condition_2' equal to "Y" which will set the value to 25. Any other value of 'Condition_2' will set the value to 50. For the diameter I'm using a Boolean expression, 'Condition_1', that is being driven from a Boolean Part Attribute named 'Condition'. Now all that you have to do is go to...

File -> Properties -> Attributes

...and change the value of the Attribute 'Condition' from 'True' to 'False'. Note that since this is a Boolean attribute it can have only one of two values, 'True' or 'False' (this can provide you with your YES/NO logic).

Anyway, tale a look and see if this will help you with what you're attempting to do.

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: Expressions NX9: "IF" statements

(OP)
Wow, this is good stuff John. Thank you! I can do an awful lot with what you've shown me in this example file.

I'm working my way up to feature suppression by expression as well. I know I've seen posts referencing that in the past.

Is that something you can enlighten me on as well?? I've never done it but I can see where it will be very useful.

TIA again.

Dave

RE: Expressions NX9: "IF" statements

After creating your model with all the features, in NX 9.0 go to...

Menu -> Edit -> Feature -> Suppress by Expression...

...and select the feature(s) that you wish to control and hit OK. Now go to the Expression dialog and you'll find a new expression which references the feature selected and indicating its 'Suppression Status', which when the value is '1' it is NOT suppressed, but when the value is '0' it is. Now by using the IF logic examples thst you've already seen, you can control exactly under what conditions will the feature(s) be suppressed or not. Note that if you select more than one feature to suppress, the 'Suppress by Expression' dialog will offer you an option to either create a unique suppression expression for each feature selected or a single expression that will control all of them.

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: Expressions NX9: "IF" statements

Also, when looking at the Part Navigator, Features which have a Suppression Expression assigned to them will have had their status symbol, the little square with the Green 'checkmark', modified showing it dashed instead of solid. And when a feature is actually suppressed using the expression, instead of the box being blank it will have a blue 'equal sign' in it. Also, if you enable to 'Status' column in the Part Navigator, it will indicate that the feature was suppressed by an expression. Also note that once you've set-up a feature to be Suppressed by Expression you are NOT able to manually suppress it. If you try to do so, you'll get a message in the status line indicating that this feature is controlled by 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.

RE: Expressions NX9: "IF" statements

(OP)
Got it... thank you again. This is great stuff. Now to cram in a week of nothing but this and I'll be an expert.

I really like this method of controlling families of standard parts. That is with out using part families. There is no spread sheet connection or master part to break off from when doing this. The simple change of a catalog number in an expression or attribute morphs the whole part or entire assembly into something else. Including links to construction solids used in mating parts. There are no other dependencies to manage.

However, two weaknesses in how this presents to the user are:

1. There are a lot of expressions used to control a feature rich part. All of which are in the "user" expression category. Is there a way to hide them in a different category to simplify what the user is presented with???? It would be much nicer to only see the expressions that require user input.

2. If the model / ass'y is driven with a variable such as a part number... there may be dozens of long catalog numbers that are very similar. LJ.750.013, LJ.750.025, LJ.500.100 ETC... Any suggestions on where they can be stored within the part file for reference? Or even to cut and paste? A PMI note... a simple drafting table?? I normally use the comment section when the options are small. But the lengthy stuff doesn't make that practical.

Just getting this far has taken some time. While I know there are more advanced ways of making and presenting dialogue boxes. I doubt that is within reach for me at this point.

TIA once again and cheers!

Dave

RE: Expressions NX9: "IF" statements

For both #1 and #2 I'd look at using Attributes to drive Expressiona. For #1 you could put all of your 'user entry' 'expressions' as Attributes, entering them from there. And using Attributes also allows you to control such things a floating point values versus integer entry. Or if there are a limited number of valid inputs, you could create a list of only those values which are valid, and of course you can use the Boolean attributes for simple True/False (i.e YES/NO) choices.

As for #2, again you could use a String Attributes with pre-defined set of valid entries.

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: Expressions NX9: "IF" statements

(OP)
Ok... do you mean you can place the math into an attribute or just use the attributes to isolate the expressions to the standard naming schemes of p312, p313 etc... to keep them out of the "user" expressions list??

I'm thinking the latter of the two... I can try it this after noon.

Dave

RE: Expressions NX9: "IF" statements

No, the use of the attributes will not necessarily change the listing behavior when in the expression system, just that using the Attribute dialog as the 'portal' for accessing those 'expressions' which you would like the user to modify allows you to hide everything except that which you've deemed as relevant. It's like in that original model I shared with you. You could have told someone to open the expression dialog and edit the "Y" value to "N", or you could have told them to go to the Attribute dialog and simply switch the Boolean attribute from "True" to "False". That way they need to know nothing about the Expressions themselves. You could have a hundred expressions with different names and created using different techniques yet all of that could remain hidden by simply using a few Attributes to change the driving parameters of your design. And since you can set up lists of possible values, control floating point versus integer, binary (True/False) conditions or just a simple user entered value, you'll have a lot more flexibility to create an 'interface' suited to the skills of the user as well as hiding all the gory details.

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: Expressions NX9: "IF" statements

(OP)
Yes, Thanks John. I can see exactly what you mean now and that's pretty slick. I may or may not use the attribute portal method because I can't gain access to those attributes with out making the component the "displayed" part. Unless of course you can take me to school on that too!? I'd like to be wrong but that is the only way I know to get at them at this point.

Alternatively, if I make the part the "work" part from a higher assembly level, the "user" expressions are available in the part navigator. Being able to reach down from multiple levels up to make the changes is an important benefit. It allows the user to visually witness it in real time. I've found that very handy in immediately identifying positive and negative effects of the change. Sometimes there is a bad "mate" or "wave link" that stands out when the shift takes place.

Dave

RE: Expressions NX9: "IF" statements

Quote (3dr)

I can't gain access to those attributes with out making the component the "displayed" part

Select your component, choose properties -> Attributes; change the 'context' setting from component to part. You now have access to the part's attributes.

www.nxjournaling.com

RE: Expressions NX9: "IF" statements

(OP)
Your kidding me.. I've suffered with that forever!

Thanks Cowski. Is there a way to make that the default setting????

Dave

RE: Expressions NX9: "IF" statements

Don't feel too bad... It was added fairly recently (NX8?). If you recently upgraded from NX7.5, it was never an option for you.

I don't know how to make it the default, perhaps dialog memory will open it to the last used option?

www.nxjournaling.com

RE: Expressions NX9: "IF" statements

Yes, it is the same/similar thing. It was re-labeled in 8.5 and 9 and might have an added option. I'll have to look again when I'm back in front of NX.

www.nxjournaling.com

RE: Expressions NX9: "IF" statements

The functionality was added in NX 8.0 as part of the larger Attribute enhancement project. The only thing that we did in NX 8.5 was to clean-up the terminology used since it was confusing and was a bit too wordy, as seen below.

This is what the NX 8.0 Component Properties dialog looks like:



And this is what the NX 8.5 Component Properties dialog looks like:

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: Expressions NX9: "IF" statements

Hello John,

You stated "And since you can set up lists of possible values".
Is this a list off possible Attribute Values?
And if so, how is this done?

Kind regards,

RE: Expressions NX9: "IF" statements

(OP)
Ok... I'm sold on the "attribute" driven method since I can gain direct access to them from higher up in the assembly. I've got my first part family ready to go.

My only gripe is that I just noticed all four "context" selections on the attributes tab look exactly alike. The dialogue opens in the "Component" context. Which displays exactly the same attributes as the "Part" Context. You can even change the attributes in Component context but of course nothing happens.

It's just easily confusing even for me the guy who set it up... let alone another user.

Do you have any recommendations for this?? Other than deal with it! lol

TIA Dave

RE: Expressions NX9: "IF" statements

(OP)
Good Question PascalDW. I didn't notice that comment.

If this can be done it could be a huge asset. I noticed there is a "Allow multiple Values" Check box in the Attribute Dialogue. I'm wondering if this provides a window to list of some sort. I tried the help files "in context" to find out and didn't notice anything info on it.

Dave

RE: Expressions NX9: "IF" statements

Part Attributes are inherited as Object Attributes of the Component when it's added to an Assembly. What you're seeing initially are these inherited Attributes. But changing or adding new ones, excpet for that last option which gives you access to the actual Part Attributes of the master part model, in the 'context' of the Assembly will effect THAT particular Component in THAT paricuar Assembly. As for the 'Instance' option that is for cases where the same Component might have been added multiple times to the same Assembly, such as a pair of brackets and you'd like to edit/edd a different attribute to ONE of the 'Instances' but not the other. If you edit/add the attribute to the 'Component' itself then it will apply to ALL instances in the Assembly. I hope the clears things up for you.

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: Expressions NX9: "IF" statements

To address the question asked by PascalDW, I've attached a simple part file (this file was created using NX 8.0, the first version where these capabilities were available) demonstrating some ways that you can use Attributes to control the Expressions driving a model.

When you go to...

File -> Properties -> Attributes

...you'll find the following Attributes in a category titled 'User_Entry':

Blend = True

This is a Boolean Attribute controlling whether there is a blend on the model or not, using Suppress by Expression.

Blend_Radius = 10 mm

This is a 'List' Attribute offering ONLY three pre-defined Blend sizes. You MUST select one of the three choices.

Diameter = 100 mm

This is also a 'List' Attribute offering five different diameters for the cylinder, however in this case you have the choice of either selecting one of the five pre-defined sizes OR you can type in any size that you desire.

Height = 100 mm

And the last Attribute allows you to enter any desired value BETWEEN 50 and 200 mm.

Now all of these Attributes were set-up by using the tools found at...

File -> Utilities -> Attribute Templates...

...and creating what we call a 'Part File' template which means that it only effects the current part file. You can also create 'Catalogs' of attributes which can be available whenever you're creating a new part file even if you've never set up any pre-defined attributes for that part file template. Note that you do NOT need to use the Utilities -> Attribute Template... workflow if all you're doing is creating adhoc attributes on the fly, but you must go this route if you wish to set-up the various list or limits type attributes.

Anyway, I hope this helps you all better understand how attributes can be used to control many aspects of your models.

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: Expressions NX9: "IF" statements

(OP)
Now that is slick John, and very useful!

But I'm playing around with creating my own "Diameter" Attribute like yours and falling down badly. How did you do that?

And your "Height" Attribute Shows a Range on the left side "Value" [50, 200]
How'd you do that one????

TIA

Dave

RE: Expressions NX9: "IF" statements

(OP)
Never mind I see you posted that. I spoke to soon.. sorry man.

But how can I get those attributes to report to another attribute that passes info to the BOM??

That answer completes everything I've tried to accomplish in this thread and more.

TIA

DAve

RE: Expressions NX9: "IF" statements

Hello John,

Thanks for this all-saying-example.

I am currently located in a company, Attributes are used as a communication between purchasing/manufacturing and our CAD models.
Typical large assemblies of tubes, plates and fixation elements.
Attributes are highly used.
They/I use attributes since 11-12 years ago. But we are now in a process of streamlining the new capabilities of Attributes.
A bottleneck is the old CAD Data, which is mainly re-used (cloned), contains these old (STRING type)attributes but cannot be linked to expressions who are mainly NUMBER Type. This is logical, and we are hoping to have a simple and good working journal that finds and replaces the "old" attribute with the new style attributes.
I am sure this will be possible.
Currently a external User Function program (still NX6)is used to update all the Attributes, but it will be soon outdated, because of win64 bit converting problems.

This example perfectly shows the possibilities off the new Attribute type.
And as you explained, I have to set up Attribute Templates, this is the way to go!

Many thanks.
Pascal
OFF TOPIC Closer living to Brugge then the Antwerp guy, so do you know any name from your mothers side?
Maybe they can be tracked...

RE: Expressions NX9: "IF" statements

Note that there are Expression functions (just click on the f(x) icon at the bottom, left-side of the Expression dialog) which will convert Strings to Numbers and Numbers to Strings. The two functions that you're looking for are 'MakeNumber', which will return either an Integer or a Number of a string (if there is no decimal point it returns an Integer, otherwise you get a floating-point, or 'real' number) and 'stringvalue' which returns a string of an integer/number.

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: Expressions NX9: "IF" statements

For 3dr, you can always create another attribute which is linked to the expression which is being driven by the original 'User_Entry' attribute. In the updated version of that original file I posted (the new file is attached below) I created two new attributes on-the-fly which are linked back to the model's expressions. After you update your model by changing either the User_Entry attributes 'Diameter' or 'Height', and after updating the model, the General attributes 'Cyl_Dia' and 'Cyl_Hgt' update to reflect those values. Now you can reference these attributes anywhere you wish.

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: Expressions NX9: "IF" statements

Hei, JohnRBaker,
And can we use conditionals "IF" with constraint assemblies?
That could be useful for example with a Rubik cube, you would only allow some rotations when the perpendicular rotations are exactly a multiple of 90 degrees.

RE: Expressions NX9: "IF" statements

At the moment, the only relationship between Constraints (of any sort) and Expressions are ones with parameters and then the only thing that you can do is control the actual value of that parameter.

But speaking of NX and 'Rubik Cubes':

http://www.youtube.com/watch?v=ldLh7L6ib1Q

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: Expressions NX9: "IF" statements

(OP)
At John... I see how you got that (1) attribute value back to (1) other attribute. What I'll need to do is gather the values from Multiple Attribute to get a composite catalog Number into (1) Attribute.

These (4) are the source
Attributes = Model Tonnage Stroke Mtg Options
Type = String String String String
Values = LJ 500 050 B21

This is the target attribute and it should appear like:
BOM_CAT_NO = LJ.500.050.B21


But I can't even get this far this morning. I'm failing to pull together all I've learned at the modeling level. As you can see from above I'm using "string" attributes with numeric inputs and that's tripping up my expressions. I'm using "string" because the "number" type was drop the trailing zeros after the decimal point and its confusing. This method will be more flexible if I can get it working.

Maybe I'm trying to do something that wont work at all. This expression syntax is accepted but defaults to the "wrong entry" size.

if (Attr_Tonnage=300)(38) Else (if (Attr_Tonnage=500)(44.5) Else (if (Attr_Tonnage=750)(50) Else (Wrong_Entry)))

Do I need to convert that string data to a number first to be able to do this? I see you mentioned that above.

I've attached a screen dump in case it helps.

I'm going to keep working on this till it's solved. Hope I'm not wearing you out!

TIA Dave


RE: Expressions NX9: "IF" statements

(OP)
Ok, S=syntax problem solved from post above and Model is fully built.

Just need to create (1) Attribute from the (4) as shown in previous post.



RE: Expressions NX9: "IF" statements

OK, see the attached file as I think this will get you going in the right direction. Again, the file was created using NX 8.0 just in case others want to see what the solution was.

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: Expressions NX9: "IF" statements

(OP)
That answer is the bomb John and exactly what I was looking for.

Thanks so much for all the help and have a great holiday!!!


Dave

RE: Expressions NX9: "IF" statements

(OP)
Ok one more question. lol

Attribute, Tonnage (Dia) / Attribute , Stroke(Length)
These two combine to form the basic size of the part. But all the selections in the "list" for "Stroke" don't go with every selection in the list for "Tonnage"

I designed the expression architecture to avoid the possibility of building a model that isn't commercially available. I needed to do that.
But the Error fallout leaves the user hanging.

Is there any practical way to deal with that?? Can I get my own message to appear??? "Choose a Compatible Stroke" or something. I'm definitely stretching I know.

Maybe I should have combined those two attributes into one. I had it that way on the pilot part I did first but I abandoned it. The possible attribute "list" was sooooo long and so were all the expressions.

TIA

Dave

RE: Expressions NX9: "IF" statements

Do you have a matrix showing the legitimate combinations? Are they limited to just 'Tonnage' versus 'Stroke' or are the other variables also linked to something like 'Tonnage'?

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: Expressions NX9: "IF" statements

(OP)
There are 11 other expressions looking at Tonnage to determine what size they should be. Screw diameters and depths, radii, etc...

I don't have a matrix to show how all this is put together, I kinda winged it all. But, I exported the expression list and included it as an attachment here.

I'm willing to re-construct the whole thing if there is a better architecture. This is the first of about 6 part families and I want to get it right.

Thanks

Dave

RE: Expressions NX9: "IF" statements

About the Rubik video.... I guess the creator of the video doesn't try to move the pieces as in real life, he doesn't need that NX checks for any restrictions, contact..., he just creates a pre-calculated motion in the way you know is OK.

Could it be done with GRIP or NX ? (I mean a macro that modifies the constraints depending on conditions).

RE: Expressions NX9: "IF" statements

The video, which I created BTW, just rotates the blockes in a predetermined set of movements which yes, I already knew was a valid solution (I actually found a website where if you enter the description of the initial face colors that it will return a step-by-step list of steps which will solve the cube in the least number of moves). And as I previously stated, the control of constraints is not as easy as suppressing and un-suppressing features. Now I would never try this with GRIP but perhaps NX Open could tackle this, however you'd still need to find some sort of Rubik 'solver' which could be incorporated into the program or if you're good enough, you could write one yourself.

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: Expressions NX9: "IF" statements

A comment for 3dr before I go any further, it would appear that you're attempting to create some sort of model which can be used in ether a Metric or Imperical units situation. If this is true, I would highly recommend that you create two different models.

Anyway, I have an idea which could extensively reduce the number and complexity of your 'IF' statements, but first a question. It would appear that there are THREE basic sizes of whatever that you're doing based on 'tonnage', 300, 500 and 750, 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.

RE: Expressions NX9: "IF" statements

OK 3dr, I made some assumptions based on what I saw in your expression sample and decided to take it to the next level and introduce you to the concept of 'List' expressions and the 'nth' function. As you can see from the attached sample file (again, saved as an NX 8.0 file) this approach is very useful when you need to set certain expression to certain values based on the value of other expressions. And as you will also see, it avoids having to create complex IF statements. In fact I basically did what you had in the sample list but I never used a single IF statement yet as you set the Tonnage or the Stroke attributes you'll see that the rest of your expressions update to the values that you wanted.

Anyway, take a look as this can save you a lot of complexity once you learn how to use 'List' expressions and then use the 'nth' function to pull values from these lists.

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: Expressions NX9: "IF" statements

(OP)
John, Thank you again. Do you ever rest!?

This is a much improved format and really condenses things. It will take me a some time to break it down to the point where I can write my own stuff tho and I may have some questions.

First on the list is whether or not I can control the presented "list" options for the "stroke" attribute based on the selection for "tonnage"?

I can see that this is a hurdle that I'm going to see a lot more more of.



Dave

RE: Expressions NX9: "IF" statements

(OP)
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

RE: Expressions NX9: "IF" statements

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.

RE: Expressions NX9: "IF" statements

(OP)
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

RE: Expressions NX9: "IF" statements

(OP)
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

RE: Expressions NX9: "IF" statements

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.

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