Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

get an error code from an NXOpen.NXException?

To all

 

I haved a small piece of code whith a Try...Catch loop. The loop is used in the event of Nx not being able to create a result. Works fine.

 

I am doing some testing and the exception thrown is the full error message displayed to the user (it is the expected error) when doing the step manualy.

 

Question is: Is there an a way to find an associated error code with the message?

 

While i am sure I could do a check on the partial/full string being thrown it would be "nicer" to have an error code to work with

 

Thanks

Regards

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
3 REPLIES
Solution
Solution
Accepted by topic author selex_ct
‎04-07-2017 08:58 AM

Re: get an error code from an NXOpen.NXException?

NXOpen.NXException has a Message() property that returns the error text. There is also an ErrorCode() property that returns the integer error number.

Re: get an error code from an NXOpen.NXException?

Thanks. So obvious I totally missed it!

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: get an error code from an NXOpen.NXException?

To get the entire exception information use the ToString() method of the exception Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community