I'm writing a WinForm application with NxOpen feature for NX9.
The code run a loop varying a parametric expression and update the features as consequence.
If a feature failed, for example due to a tangency of 2 surfaces, the code crash and the execution stop.
In particular I noticed that the code crash on the command:
when the parametric expression is set to the value that causes the surface tangency.
I tried to use:
but this doesn't work before the update session.
I hope I was clear
Thanks in advance
Solved! Go to Solution.
Most languages have a "try...catch" type construct.
Use that around your code, then deal with the error in the "catch" block?
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled
Try Dim nErrs1 As Integer
nErrs1 = theSession.UpdateManager.DoUpdate(undoMark)
Catch ex As Exception ' report the outcome
System.Diagnostics.Trace.WriteLine("Error " & ex.Message)
MessageBox.Show("Exception: " & ex.Message)
' revert to previous session state
There are several examples in
I have another error that this code cannot manage.
If I have a problem with a pop-up window the previous code doesn't work.
Please see the image:
If I click OK the RUN goes on but the measure that the code does are incorrectly.