Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Trouble with a simple expression

Status
Not open for further replies.

barbarus

Mechanical
Feb 27, 2014
12
hello,

it's the first time i write in this fantastic forum (i read your tips every day).
I have a trouble with a simple expression.

In my drawing file i have one part attribute called p1 that can have this two string value: "Released" or "working".
according to the value assumed i need to fill another part attribute call p5 with a specific value.
So i try to insert a conditional like this:

if p1=stringValue( Released ) then p5=stringValue( Approved ) else p5=stringValue( Not Approved )

every time the program tell me that the string contain a syntax error..

i use NX 8.5.3

where is the fault?

Thanks.

Luca
 
Replies continue below

Recommended for you

Try this

(if (P1="RELEASED")("APPROVED")else("NOT APPROVED"))
 
Is it a single = typically ued for setting a value or should it be a double == typically used for comparisons?
I have not used NX in a few years, but I know Wildfire uses the = and == like I asked about.
Regular Expressions also uses the = and == that way.

Also in your screen shot, you have P1 set to Release and your P5 evaluation is looking for Released.




"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli
 
If you're running NX 8.5 I would use something like a pre-defined String Attribute limited to either the value of 'Not Released' or 'Released' and then just link my note to the the value of that Attribute. Then when you want to change the status, just go to...

File -> Properties -> Attributes

...and simply toggle between the two pre-defined values of the 'Release_Status' attribute, as you can do with the attached example file.

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=c8a15c61-d59d-48e0-bdaa-1434ea71546f&file=Attribute-Note_Example.prt
Status
Not open for further replies.

Part and Inventory Search

Sponsor