How to determine if file is checked out?
Posted: Mon Sep 16, 2024 1:55 pm
I have some code that successfully checks files out, saves them, checks them back in, or undoes checkout. What I can't get it to do is correctly report if a file is checked out. pdmFile.IsLocked always returns FALSE.
Here's my code.
Thank You
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