We all know there are three way to unload shared image...
'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
'Unloads the image explicitly, via an unload dialog
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
But sometime we have to choose GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly for open a VB form with "theform1.show()", that could at the same time to select NX object and VB dialog, like we do part list with Datagridview.
Now I record a macro program to unload shared image, it no problem, but whether we have better way to achieve that?
Solved! Go to Solution.
While that is a fine solution, why wouldn't you just call the UnloadNXLibrary() subroutine in the closing event of your windows form? This avoids the issues with multiple threads. I have just implemented this in a project I'm working on.