使用Vault Api签出dwg文件

本文关键字:dwg 文件 签出 Api Vault 使用 | 更新日期: 2023-09-27 18:02:22

我使用以下代码签出文件,但它很少工作。

我的代码是
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文件。谁能告诉我代码有什么问题吗?

使用Vault Api签出dwg文件

试试Wayne Brill的这个例子: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);
    }