Here's my code.
Code: Select all
Function IsCheckedOut(swApp As SldWorks.SldWorks, ByVal pdmVault, handle As Long, ByVal docType As Integer) As Boolean
Dim swModel As SldWorks.ModelDoc2
Dim pdmFile As IEdmFile5
Dim pdmFolder As IEdmFolder5
Dim iStatus As Integer
Set swModel = swApp.ActiveDoc
Set pdmFile = pdmVault.GetFileFromPath(swModel.GetPathName, pdmFolder)
If pdmFile.IsLocked Then
IsCheckedOut = True
Else
IsCheckedOut = False
End If
End Function