[使用Forge Design Automation API将BIM 360中的Revit文件另存为云模型

问题描述 投票:1回答:1

我想将Revit文件上传到BIM 360,并以云模型进行处理。

我正在使用Design Automation API来做到这一点。

出于某种原因,我看到一条错误消息:“无法获取授权服务器”

这是我的AppBundle代码:

public class MyDaApp : IExternalDBApplication
{
    public ExternalDBApplicationResult OnStartup(ControlledApplication application)
    {
        DesignAutomationBridge.DesignAutomationReadyEvent += HandleDesignAutomationReadyEvent;
        return ExternalDBApplicationResult.Succeeded;
    }

    public ExternalDBApplicationResult OnShutdown(ControlledApplication application)
    {
        return ExternalDBApplicationResult.Succeeded;
    }

    public void HandleDesignAutomationReadyEvent(object sender, DesignAutomationReadyEventArgs e)
    {
        e.Succeeded = true;
        DoSomething(e.DesignAutomationData.RevitDoc);

    }

    public void DoSomething(Document doc)
    {
        doc.SaveAsCloudModel(@"urn:adsk.wipprod:fs.folder:co.alJahHjZSsG3m-mLlrcHNw", "Some File");
    }
}

我创建WorkItem后,其状态为“ failedInstructions”。这是它生成的异常日志报告:

[06/10/2020 14:55:09] Initialize and  get RCE: (VersionBuild) 20.0.0.0 (VersionNumber) 2020 (SubVersionNumber) 2020.2
[06/10/2020 14:55:12] Autodesk.Revit.Exceptions.InvalidOperationException: Could not obtain entitlement server.
[06/10/2020 14:55:12]    at Autodesk.Revit.DB.Document.SaveAsCloudModel(String folderId, String modelName)
[06/10/2020 14:55:12]    at MyAppBundle.MyDaApp.HandleDesignAutomationReadyEvent(Object sender, DesignAutomationReadyEventArgs e)
[06/10/2020 14:55:12]    at DesignAutomationFramework.DesignAutomationBridge.RaiseDesignAutomationReadyEvent(DesignAutomationReadyEventArgs e)
[06/10/2020 14:55:12]    at RevitCoreEngineTest.RceConsoleApplication.Program.UserMain(CommandLineArgs cl)
[06/10/2020 14:55:18] 湥整楲杮映湩獩偨慬批捡⸮搠獥牴祯洠偟慬批捡卫慴整਍਍潣瑮湩極杮映湩獩偨慬批捡⸮搠獥牴祯挠污卬牴慥⡭ഩഊ攊楸整⁤楦楮桳汐祡慢正਍਍RESULT: Failure - Result of running user app is failure
[06/10/2020 14:55:18] Finished running.  Process will return: TestError
[06/10/2020 14:55:18] ====== Revit finished running: revitcoreconsole ======
[06/10/2020 14:55:19] End Revit Core Engine standard output dump.
[06/10/2020 14:55:19] Error: Application revitcoreconsole.exe exits with code 4 which indicates an error.
[06/10/2020 14:55:19] End script phase.
[06/10/2020 14:55:19] Error: An unexpected error happened during phase CoreEngineExecution of job.
[06/10/2020 14:55:19] Job finished with result FailedExecution

这很奇怪,因为当我通过Revit UI将doc.SaveAsCloudModel方法作为ExtrnalApplication运行时,一切正常。

autodesk-forge revit-api autodesk-bim360 autodesk-designautomation
1个回答
3
投票

这是Design Automation的当前限制,只能将模型保存到云计算机的当前工作目录中。这是因为禁止用户应用程序访问网络。

因此,Design Automation当前不支持doc.SaveAsCloudModel()。也就是说,我们注意到您对设计自动化中BIM 360功能的要求!

谢谢,迈克尔

© www.soinside.com 2019 - 2024. All rights reserved.