Unload the GUI form from NX

Hello all,

I am working on NXOpen and I have created on simple form just to set projection angle by selection.
But I am not able to unload that form from NX Meomry.
I have tried all three options show in below code.
Please help me to overcome this problem.

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image explicitly, via an unload dialog
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly

'----Other unload options-------
'Unloads the image when the NX session terminates
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

'Unloads the image immediately after execution within NX
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
'-------------------------------

End Function

Are you using a WinForm or an NX "blockstyler" type of form?

Also, are you compiling your code or running it as a journal?

I am using Winform and I have created .dll of that and running it through toolbar.

Bhavik S.

Try calling the .Dispose method of the form.

I tried .Dispose and .Cancel method but in this case i am not able use the same function second time.
And it gives the below error.

Error in external library
Function Name : Main

Bhavik S.