API Refresh vault status for all open documents

API Refresh vault status for all open documents

COLINBRUSCHI
Enthusiast Enthusiast
767 Views
3 Replies
Message 1 of 4

API Refresh vault status for all open documents

COLINBRUSCHI
Enthusiast
Enthusiast

Hi All,

 

After checking a part out & into vault programmatically , the vault status in the vault status panel still shows "checked out" for the part as well as open assemblies the part resides in, until the status is refreshed in all these documents. The following code executes a vault refresh command on the active document and then activates all the open documents and should refresh their vault status trees as well, however only the status of the initial active document is refreshed, any thoughts?

 

Dim pDoc As Document
Dim originalDocument As String = g_inventorApplication.ActiveDocument.DisplayName    'remember the document from which the program was run
Dim ctrDef As ControlDefinition = g_inventorApplication.CommandManager.ControlDefinitions.Item("VaultRefresh")
ctrDef.Execute()

For Each pDoc In g_inventorApplication.Documents.VisibleDocuments   'activate each open document

     If Not pDoc.DisplayName.Contains(originalDocument) Then

pDoc.Activate() ctrDef.Execute() End If Next For Each pDoc In g_inventorApplication.Documents.VisibleDocuments 'activate the original document If pDoc.DisplayName = originalDocument Then
pDoc.Activate() End If Next
0 Likes
768 Views
3 Replies
Replies (3)
Message 2 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@COLINBRUSCHI,

 

Are you using standalone application or iLogic code to refresh the vault status?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 4

COLINBRUSCHI
Enthusiast
Enthusiast

Standalone add-in.

 

The code that does the checking in is below.

 

''''' Check file in if checked out
        Dim oFileIteration As VDF.Vault.Currency.Entities.FileIteration = Await getFileIteration(oDoc.FullFileName, oConnection)

        If oFileIteration IsNot Nothing Then

            If oFileIteration.IsCheckedOut = True Then

                Dim fldrPath As VDF.Currency.FolderPathAbsolute = New VDF.Currency.FolderPathAbsolute(mfilePath)
                Dim filePathAbs As VDF.Currency.FilePathAbsolute = New VDF.Currency.FilePathAbsolute(oDoc.FullFileName)

                statusCaption.Text = "Checking File Back In..."
                Refresh()

                oConnection.FileManager.CheckinFile(oFileIteration, lblComments.Text, False, New ACW.FileAssocParam() {}, Nothing, False, Nothing, ACW.FileClassification.None, False, filePathAbs)

            End If
        End If
0 Likes
Message 4 of 4

chandra.shekar.g
Autodesk Support
Autodesk Support

@COLINBRUSCHI,

 

Can you please post the same question at Vault customization forum using below link?

 

https://forums.autodesk.com/t5/vault-customization/bd-p/301

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes