• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk Vault Customization

    Reply
    Active Contributor kbo
    Active Contributor
    kbo
    Posts: 32
    Registered: 08-18-2010
    Accepted Solution

    Refresh Vault Pro Explorer

    137 Views, 4 Replies
    01-18-2012 05:15 AM

    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

     

    Contributor
    m.becher
    Posts: 12
    Registered: 09-22-2011

    Re: Refresh Vault Pro Explorer

    01-18-2012 05:44 AM in reply to: kbo

    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

     

    Active Contributor kbo
    Active Contributor
    kbo
    Posts: 32
    Registered: 08-18-2010

    Re: Refresh Vault Pro Explorer

    01-18-2012 06:28 AM in reply to: m.becher

    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

     

    Contributor
    m.becher
    Posts: 12
    Registered: 09-22-2011

    Re: Refresh Vault Pro Explorer

    01-18-2012 07:40 AM in reply to: kbo

    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.

    Active Contributor kbo
    Active Contributor
    kbo
    Posts: 32
    Registered: 08-18-2010

    Re: Refresh Vault Pro Explorer

    01-20-2012 01:09 AM in reply to: m.becher

    Thanks for Your help :smileyhappy: ended up with this and now it works.

     

     e.Context.ForceRefresh = True