Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Post Builder ask expression

Pioneer
Pioneer

That didn't work either. I called GTAC. We'll see what they have to say.

 

Thanks,

Ron

Re: Post Builder ask expression

Phenom
Phenom

Debugging code is a necessity in post builiding. One of the ways I do it is:

 

MOM_abort "\n\n .... \n\n"

 

This will pop up an error with whatever is between the quotes (in place of the ....) - variables etc.

 

 

NX12.02
Windows 10 Pro

Re: Post Builder ask expression

Pioneer
Pioneer

Update: The problem was the outer brackets around the catch statement should be curly braces. 

 

Right: catch {set expVal [MOM_ask_ess_exp_value EXPRESSION1]}

 

Wrong: catch [set expVal [MOM_ask_ess_exp_value EXPRESSION1]]

 

They wern't sure how and why it worked in 8.5.

 

Silly

 

Thanks for the help,

Ron

 

 

Re: Post Builder ask expression

Phenom
Phenom

See code in my last post. It had the curly braces. I had tested this in a tcl shell window. If you have not installed activestate tcl - I would recommend it. You can open a command prompt and test code.

NX12.02
Windows 10 Pro

Re: Post Builder ask expression

Siemens Legend Siemens Legend
Siemens Legend

You need to do "catch {...}" with curly braces instead of brackets.

 

  catch { set expVal [MOM_ask_ess_exp_value A_SURFACE_PLATE_HEIGHT] }

 

When you use "catch [...]", the statement between [] will be executed right away (that's what [] means) instead of being enclosed for "catch" to evaluate. Then, it will fail during the execution of "set", because "MOM_ask_ess_exp_value" returns nothing in this case, since the attr doesn't exist. "set expVal" became a syntactically incorrect statement, and thus failed.

 

It may have worked prior to NX9 when NX uses Tcl8.0 (for WIndows), which handles certain error situations a little differently. NX/CAM upgraded its Tcl to "8.4" in NX9.

Learn online





Solution Information