I made a program for Vault 2013. Unfortunately it don’t work for Vault 2014. I’ve tried to figure out how to rewrite it to 2014, but I struggle. The problem is DownloadFile that has been removed from WebServices. I had the lines below in my code. It should get a file from Vault by Id and save the file in the folder “c:\Vault export\” outside our local Vault area. Any tip on how I should rewrite it would be appreciated.
docSrv.DownloadFile(oFileAssoc.ParFile.Id, True, oBytes)
System.IO.File.WriteAllBytes("C:\\" + "Vault export\" & oFileAssoc.ParFile.Name, oBytes.Bytes)
http://justonesandzeros.typepad.com/blog/2013/05/how-to-acquire-files.html
Thanks.
But if I got a fileid for instance 2591234 how do I convert it to an ICollection so that I can use the sub
Public Sub DownlodFiles(fileIters As ICollection(Of VDF.Vault.Currency.Entities.FileIteration))
I found a method.
Imports Framework = Autodesk.DataManagement.Client.Framework
Dim lFileIds(0 To 0) As Long
lFileIds(0) = lIndex
Dim oFiles As Autodesk.Connectivity.WebServices.File()
oFiles = m_conn.WebServiceManager.DocumentService.GetFilesByIds(lFileIds)
Dim FileList As List(Of Autodesk.Connectivity.WebServices.File)
FileList = New List(Of Autodesk.Connectivity.WebServices.File)()
If (Not lFileIds Is Nothing) Then
FileList.AddRange(oFiles)
End If
Dim oFileIteration As Framework.Vault.Currency.Entities.FileIteration
oFileIteration = New Framework.Vault.Currency.Entities.FileIteration(m_conn, FileList(0))
That code works, but there is an easier way. You can call m_conn.FileManager.GetFilesByIterationIds(...)
Can't find what you're looking for? Ask the community or share your knowledge.