Hello there, I know this is somewhat old, but i found a need for having the folder tree as well. Since my company uses Inventor predominantly, i wrote an iLogic Rule to do just this and can be run by any user with Inventor+Vault. You or any other users that happen across this will just have to modify the local path to what you use.
If you don't have/use inventor, then it could be converted to a standalone application, vault extension, powershell script, or other, would have to change the login code at the very least. However, my current knowledge is limited to running it through inventor and I have no need to expand it, so i wont convert it myself.
AddReference "Autodesk.DataManagement.Client.Framework.Vault.dll"
AddReference "Autodesk.DataManagement.Client.Framework.dll"
AddReference "Connectivity.Application.VaultBase.dll"
Imports VDF = Autodesk.DataManagement.Client.Framework
Imports VB = Connectivity.Application.VaultBase
'''''''''''''''''''''''''''''''''''''''
''' Author: greg
'''''''''''''''''''''''''''''''''''''''
''' Syncs entire folder structure of vault to local workspace. Creates folders only, does not get any files
Sub Main()
'get active vaultconnection
Dim mVltCon As VDF.Vault.Currency.Connections.Connection = VB.ConnectionManager.Instance.Connection
'check if user is logged in
If mVltCon Is Nothing OrElse mVltCon.UserName Is Nothing OrElse mVltCon.UserName = "" Then
MessageBox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.")
Exit Sub
End If
'get vault root folder
Dim root As VDF.Vault.Currency.Entities.Folder = mVltCon.FolderManager.RootFolder
'get full list of folders, using recurse parameter. Downselect to the folder name
Dim vaultPaths As IEnumerable(Of String) = mVltCon.FolderManager.GetChildFolders(root, True, False).Select(Function(c) c.FullName)
'modify vault paths into windows local paths
Dim localPaths As IEnumerable(Of String) = vaultPaths.Select(Function(c) c.Replace("$/", "C:\Workspace\").Replace("/", "\"))
Dim errs As New ArrayList
'make directories if not existing
For Each dr As String In localPaths
Try
If Not System.IO.Directory.Exists(dr) Then
System.IO.Directory.CreateDirectory(dr)
End If
Catch
errs.Add("Could not make folder: " & dr)
End Try
Next
'show errors if any
If errs.Count > 0 Then MsgBox(String.Join(vbCrLf, errs.ToArray))
End Sub