Cancel
Showing results for 
Search instead for 
Did you mean: 

get an error code from an NXOpen.NXException?

Phenom
Phenom

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

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

Siemens Phenom Siemens Phenom
Siemens Phenom

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?

Phenom
Phenom

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?

Esteemed Contributor
Esteemed Contributor

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: NX12.0

How to Get the Most from Your Signature in the Community