Hi Rikard,
I did a quick test with this SDK sample:
C:\Program Files (x86)\Autodesk\Autodesk Vault 2016 SDK\vs12\CSharp\VaultBrowserSample
With a few edits it was able to download all the files from a folder. (they were the latest versions). Below are the changes I made. Maybe you could update that sample to show what the problem is you are getting. Also explain where the error occurs and what it is.
public partial class Form1 : Form
{
#region Member Variables
//WB made public and static
//private Vault.Currency.Connections.Connection m_conn = null;
public static Vault.Currency.Connections.Connection m_conn = null;
...
void m_model_SelectedContentChanged(object sender, Forms.Currency.SelectionChangedEventArgs e)
{
//when the selected content changes, we need to update the filename field to reflect the selected entities
List<Vault.Currency.Entities.IEntity> selectedEntities = new List<Vault.Currency.Entities.IEntity>(e.SelectedEntities);
// bool fileSelected = false;
//WB testing - so I can run the Open command with a folder selected
bool fileSelected = true;
...
private void OpenFile()
{
//WB testing - running a new function that downloads a folder
Vault.Currency.Entities.Folder fldr = m_model.SelectedContent.FirstOrDefault() as Vault.Currency.Entities.Folder;
string folderPath = System.IO.Path.Combine(Application.LocalUserAppDataPath, "WB_Test");
OpenFileCommand.downloadFile_WB(m_conn, fldr, folderPath);
return;
//WB end
//WB added
// private static void downloadFile_WB(VDF.Vault.Currency.Connections.Connection connection, VDF.Vault.Currency.Entities.Folder fldr) //, string folderPath)
public static void downloadFile_WB(VDF.Vault.Currency.Connections.Connection connection, VDF.Vault.Currency.Entities.Folder fldr, string folderPath)
{
VDF.Vault.Settings.AcquireFilesSettings settings = new VDF.Vault.Settings.AcquireFilesSettings(connection);
settings.AddEntityToAcquire(fldr);
settings.LocalPath = new VDF.Currency.FolderPathAbsolute(folderPath);
connection.FileManager.AcquireFiles(settings);
}
//WB end added
...
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network