Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

expression format

Status
Not open for further replies.

jonnyra

Aerospace
Jan 12, 2010
11
0
0
US
Looking for a way to achieve the following:

I have an expression where the user inputs a number between 1 and 10:
wzp=3

I also have 10 expressions defined as: wzp_out[1-10]= ###

Now I want to call out a wzp_out variable based on the value of wzp:

wzp_out[value of wzp] = wzp_out3

So the result in my formula line would be interpreted as wzp_out3 thereby calling the value of wzp_out3 in my formula.

I thought i had seen something like (wzp_out[wz]) and the system interprets it as wzp_out3. Anything I try is giving me errors. Anyone have the proper format for this?

Thanks in advance.
 
Replies continue below

Recommended for you

What version of NX are you running?

Starting with NX 8.0, we implemented a new expression type called a 'List' expression which can be used to do exactly what you have in mind.

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.
 
Assuming that you're running either NX 8.0 or NX 8.5, I've created a very simple example file showing how you can make all this work. Open the attached file, but don't go the Expression dialog right-away. Rather, go to...

File -> Properties...

...where you will find two Attributes, 'wzp' and 'wzp_out'. The attribute, 'wzp' can be set to any integer value between 1 and 10. The attribute 'wzp_out' represents that list of 10 expression values that you want the system to return based on which value you choose for 'wzp'. Anyway, select the 'wzp' attribute and in the value field you'll see that you can select any value between 1 and 10. Select whatever value you desires and then hit the 'Appy' button and you'll notice that the 'wzp_out' attribute will update. Also notice that the PMI note on the screen will also update since it's linked to the values of the expressions which are linked to the attributes.

OK, now you can open the expression dialog and with the filter set to 'All' you can review the expressions and you should get an idea how this all works.

Anyway, I hope this helps you with what you're looking for.

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.
 
 http://files.engineering.com/getfile.aspx?folder=ff7cb2c7-18dc-4c88-bda5-d7d045a2800b&file=List_Expression_Example-JRB-1.prt
Status
Not open for further replies.
Back
Top