Hi,
I tried to use CommandInProgress property, but I have issues with it.
2010 SOLIDWORKS API Help - CommandInProgress Property (ISldWorks)
I'd like to set this property to True before my app begins to work, and like to set to False when it ends, like the link said above.
I have this Modules /Classes:
Public Class MainForm
Public Sub MainForm_Load... 'This runs first
SwxConnectModule.SwxConnect()
...
Public Module SwxConnectModule
Public swApp As SldWorks.SldWorks
....
Public Class myForm
Public Sub myForm_Load...
...
Public Sub myForm_FormClosed...
...
I tried this many ways seen below, but seems I couldn't set this property.
Method 1
Public Module SwxConnectModule
Public swApp As SldWorks.SldWorks
....
Public Class myForm
...
Public Sub myForm_FormClosed..
swApp.CommandInProgress = False
Debug.Print(swApp.CommandInProgress) '--This prints True
...
Method 2
Public Module SwxConnectModule
Public swApp As SldWorks.SldWorks
Public swIApp As SldWorks.ISldWorks '--ISldworks Interface
....
Public Class myForm
...
Public Sub myForm_FormClosed...
swIApp.CommandInProgress = False '--This occurs: Exception thrown: 'System.NullReferenceException' in SWXapp.exe
Debug.Print(swApp.CommandInProgress)
...
Method 3
Public Module SwxConnectModule
Public swApp As SldWorks.SldWorks
....
Public Class myForm
Public swIApp As SldWorks.ISldWorks '--ISldworks Interface inside myForm Class
...
Public Sub myForm_FormClosed...
swIApp.CommandInProgress = False '--This occurs: Exception thrown: 'System.NullReferenceException' in SWXapp.exe
Debug.Print(swApp.CommandInProgress)
...
Method 4
Public Module SwxConnectModule
Public swApp As SldWorks.SldWorks
....
Public Class myForm
...
Public Sub myForm_FormClosed...
Dim swIApp As SldWorks.ISldWorks '--ISldworks Interface inside closing Sub
swIApp.CommandInProgress = False '--This occurs: Exception thrown: 'System.NullReferenceException' in SWXapp.exe
Debug.Print(swApp.CommandInProgress)
...
Anybody has any idea?
Thank you
SolidworksApi macros