使用Vault Api签出dwg文件

时间:2014-05-07 12:30:51

标签: c# winforms autocad

我使用以下代码签出文件,但很少用。它适用于特定文件,但对某些文件不起作用。

我的代码是

oSettings.DefaultAcquisitionOption = VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Checkout | VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download;                            
oSettings.LocalPath = fldrpathco;
oSettings.AddEntityToAcquire(oFileIteration);
connection.FileManager.AcquireFiles(oSettings);                            
string p = oSettings.LocalPath.ToString() + oFileIteration.ToString();

我的要求是在工作文件夹中下载dwg文件。谁能告诉我代码中可能出现的问题?

1 个答案:

答案 0 :(得分:2)

韦恩·布里尔尝试这个例子:http://adndevblog.typepad.com/manufacturing/2013/06/use-or-with-defaultacquisitionoption-to-download-checkout-with-acquirefiles.html

参考代码:

    private static void downloadFile (VDF.Vault.Currency.Connections.Connection connection, 
        VDF.Vault.Currency.Entities.FileIteration file, string folderPath)
    {
        var settings = new VDF.Vault.Settings.AcquireFilesSettings(connection);
        settings.AddEntityToAcquire(file);
        settings.DefaultAcquisitionOption = VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Checkout |
                                            VDF.Vault.Settings.AcquireFilesSettings.AcquisitionOption.Download;

        settings.LocalPath = new VDF.Currency.FolderPathAbsolute(folderPath);

        connection.FileManager.AcquireFiles(settings);
    }