Vault folder.

Vault folder.

Anonymous
Not applicable
711 Views
4 Replies
Message 1 of 5

Vault folder.

Anonymous
Not applicable

If I have a Vault file. How can I get the Vault folder for the file? There are no folder in the list (see picture.)

0 Likes
712 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

Found it.

 

Dim oVaultFolder As Autodesk.Connectivity.WebServices.Folder()

oVaultFolder = m_docSvc.GetFoldersByFileMasterId(selectedFile.File.MasterId)

 

Dim sVaultFolder As String

sVaultFolder = oVaultFolder(0).FullName

0 Likes
Message 3 of 5

Anonymous
Not applicable

Be carefull. You might end up with the wrong folder as you are refering to the masterID of all versions.

I believe docserv.FindFoldersBySearchConditions() is the "secure" route.

0 Likes
Message 4 of 5

Redmond.D
Autodesk
Autodesk

GetFoldersByFileMasterId is the right function to use.  It is perfectly "secure".  If a file is moved, all versions move.  It's not possible for version 1 and version 2 of a file to be in different folders.

 

I don't think FindFoldersBySearchConditions can be used to locate a Folder from the information in a File object.

 

Lastly, in Vault 2014, the File object *finally* has a FolderId property.



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks for the error correction!

0 Likes