Since we updated from swx 2010 to 2011 SP04, using the 'EnableBackgroundProcessing' method in VBA while open drawings of large assemblies results in swx freezing, and needing to be forcibly closed with the task manager.
Removing the EnableBackgroundProcessing code, stops swx freezing but, it takes considerably longer to open drawings.
Drawings of smaller parts / assemblies are not affected and open fine.
Here is the code copied directly from SWX API help:
'---------------------------------------------------------------------------
' Preconditions: Specified drawing document exists.
'
' Postconditions: Specified drawing document opens.
'---------------------------------------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swDrawing As SldWorks.DrawingDoc
Dim strFileName As String
Dim longstatus As Long
Dim longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
strFileName = "c:\Program Files\SolidWorks Corp\SolidWorks\samples\tutorial\advdrawings\foodprocessor.slddrw"
swApp.EnableBackgroundProcessing = True
Set swDrawing = swApp.OpenDoc6(strFileName, 3, 0, _
"", longstatus, longwarnings)
While (swApp.IsBackgroundProcessingCompleted(strFileName) = False)
Debug.Print ("Background processing ongoing...")
Wend
swApp.EnableBackgroundProcessing = False
Set swApp = Nothing
End Sub
Any ideas?
SolidworksApi macros