Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Refresh Vault Pro Explorer

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
806 Views, 4 Replies

Refresh Vault Pro Explorer

I create some folders i the Vault explorer with code below. My problem is when the folders are createt i have to press the refresh button to get the folders to show up.

 

can anybody provide a code example on how to trigger the refresh of the Vault Client explorer?

 

regards.

 

Kent boettger

 

  Private Sub KBCommandHandler()

        'MsgBox("Trykkede KBCommand")

        Dim MyFolderParent As Folder = mDocSvc.GetFolderByPath("$/MonsunVaultFiler/Ordre")

        Dim MyFolderName As String

        MyFolderName = "PROJEKT-ABC"

        Dim MyFullFolderName As String

        MyFullFolderName = (MyFolderParent.FullName & "/" & MyFolderName)

        Try

            'Check if the folder exist

            Dim MyFolderId As Long = mDocSvc.GetFolderByPath(MyFullFolderName).Id

            If MyFolderId.ToString > 0 Then

                'MsgBox("Projekt folder findes allerede")

                MsgBox("Folder already exist")

                Exit Try

            End If

        Catch ex As Exception

            'Check if the folder exist

            'MessageBox.Show(ex.ToString(), "Projektfolder findes ikke")

            Dim MyNewFolder As Folder = mDocSvc.AddFolder(MyFolderName, MyFolderParent.Id, False)

            Dim MyNewSubFolder0 As Folder = mDocSvc.AddFolder("00-Konfigurator", MyNewFolder.Id, False)

              MsgBox("Folder was created")

        End Try

    End Sub

 

4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

If your code running as a Vault Client Extension and you Implement the IExtension Interface you can set the Property

ForceRefresh = true from the Context-Object. The Context Object are stored in the

CommandItemEventArgs in the Execute-Event from the CommandItem Object...

 

Hope this help

 

Michael

 

Message 3 of 5
Anonymous
in reply to: Anonymous

Yes it is running as a vault client extension, I can't figure out how to implement this as you descripe it please help.

 

here is me command item how do i put in this force refresh option?

 

regards.

 

Kent boettger

 

Dim

KBCmdItem AsNewCommandItem("KBCommand", "KB Command")

 

AddHandler KBCmdItem.Execute, AddressOf KBCommandHandler

 

Message 4 of 5
Anonymous
in reply to: Anonymous

You must change the Method signatur 'KBCommandHandler' to

 

  Private Sub KBCommandHandler(ByVal s As ObjectByVal e As CommandItemEventArgs)
  

 

the you can access over e.Context the Property. Look at the SDK 'Hello World' sample. Note this code is for Vault 2012 i can't say if it has change in recent API versions.

Message 5 of 5
Anonymous
in reply to: Anonymous

Thanks for Your help Smiley Happy ended up with this and now it works.

 

 e.Context.ForceRefresh = True

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report