Get Last Save Error Example (VB.NET)
This example shows how to get the last save error.
'-------------------------------------------------------------------
' Preconditions: A
SolidWorks session in which a save error occurred.
'
' Postconditions: Inspect
the Immediate Window.
'--------------------------------------------------------------------
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System
Imports System.Diagnostics
Partial Class SolidWorksMacro
Dim
varPath As Object
Dim
varError As Object
Dim
varMessage As Object
Sub
main()
varMessage
= swApp.GetLastSaveError(varPath,
varError)
If
Not varError = 0 Then
Debug.Print("The
document generating the save error was: " & varPath)
Debug.Print("The
error code was: " & varError)
Debug.Print("The
error message was: " & varMessage)
Else
Debug.Print("This
session has not experienced a save error.")
End
If
End
Sub
Public
swApp As SldWorks
End Class