There is an iLogicVault method that will get the full vault status of a file
https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=f71217f7-2541-fd59-c39d-6a93a5395db5
You can use it like this from iLogic:
Dim status As Dictionary(Of String, String)
Try
status = iLogicVault.GetVaultFileStatus(ThisDoc.Document.File.FullFileName)
Catch ex As Exception
'user is not logged into vault, or other vault exception
Throw
'return
End Try
'status is guaranteed to be populated with something
Dim ErrorState As String = status("ErrorState")
'if the file is not in vault or not yet even saved, then error state will be manually set, otherwise error state will be set by vault directly.
If status("ErrorState") = "LocalFileNotFoundVaultFileNotFound" Then
Logger.Info("New local file not yet saved!")
Return
End If
If status("ErrorState") = "VaultFileNotFound" Then
Logger.Info("File not found in Vault")
Return
End If
'if status is succesful, then it will populate with these keys
Dim CheckOutState As String = status("CheckOutState")
Dim ConsumableState As String = status("ConsumableState")
Dim LocalEditsState As String = status("LocalEditsState")
Dim LockState As String = status("LockState")
Dim RevisionState As String = status("RevisionState")
Dim VersionState As String = status("VersionState")
Logger.Info(String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}", CheckOutState, ConsumableState, LocalEditsState, LockState, RevisionState, VersionState, ErrorState))
'the possible values are listed under the EntityStatus type in the vault SDK help file
However - its speed is going to be similar to the original code you linked to. Under the hood it makes quite a few vault server calls to get the full status of the file.
Since all you care about is whether the file is checked out, it is heavier that you need.
For just checking the file's checked out status, you can use this snippet which has less vault server calls, but is a little more complex.
Imports AWS = Autodesk.Connectivity.WebServices
Imports VDF = Autodesk.DataManagement.Client.Framework.Vault
AddReference "Autodesk.Connectivity.WebServices.dll"
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
Try
Dim connection = iLogicVault.GetVaultConnection()
Dim vaultPath = iLogicVault.ConvertLocalPathToVaultPath(ThisDoc.Document.FullFileName) & "/" & System.IO.Path.GetFileName(ThisDoc.Document.FullFileName)
Dim vaultFile As AWS.File = connection.WebServiceManager.DocumentService.FindLatestFilesByPaths({vaultPath}).FirstOrDefault()
If vaultFile Is Nothing OrElse vaultFile.Id = -1 Then
Logger.Info("File not found in vault!")
Return
End If
Dim checkedOut = vaultFile.CheckedOut
Dim checkedOutMach = vaultFile.CkOutMach
Logger.Info("Checked out? " & checkedOut) 'true for false for any user
Logger.Info("Checked out by machine: " & checkedOutMach) 'the PC name, does not necessarily contain the user name
Dim checkedOutByCurrentUser = vaultFile.CkOutUserId = connection.UserID
Logger.Info("Checked out by user: " & checkedOutByCurrentUser) 'true or false, only matches if current user is the one with the file checked out
Catch ex As Exception
'user is not logged into vault, or other vault exception
Throw
'return
End Try