cancel
Showing results for 
Search instead for 
Did you mean: 

Feature failed

Pioneer
Pioneer

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:

theSession.UpdateManager.DoUpdate(markId1)

when the parametric expression is set to the value that causes the surface tangency.

 

I tried to use:

GetFeatureErrorMessages()

but this doesn't work before the update session.

 

I hope I was clear

 

Thanks in advance

 

Luigi

 

4 REPLIES

Re: Feature failed

Esteemed Contributor
Esteemed Contributor

What language?

Most languages have a "try...catch" type construct.

Use that around your code, then deal with the error in the "catch" block?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Feature failed

Pioneer
Pioneer

language: visual basic.

 

Could you give me an example on how to use try catch..

 

Thanks

Luigi

Re: Feature failed

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor
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
theSession.UndoToLastVisibleMark()
End Try

 

Luigi,

 

There are several examples in

"%UGII_BASE_DIR%\ugopen\SampleNXOpenApplications\.Net\"

 

HTH, Joe

Re: Feature failed

Pioneer
Pioneer

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:

 

screenshot.138.jpg

 

If I click OK the RUN goes on but the measure that the code does are incorrectly. 

 

Luigi