如何使用 Forge Design Automation API 将 BIM 360 中的 Revit 文件保存为云模型?
How to save Revit file in BIM 360 as cloud model using Forge Design Automation API?
我想将我的 Revit 文件上传到 BIM 360,并将其作为云模型进行处理。
我正在使用设计自动化 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
这很奇怪,因为当我 运行 Autodesk.Revit.DB.Document.SaveAsCloudModel()
方法时,作为 ExtrnalApplication
通过 Revit UI,一切正常。我只在设计自动化云上得到异常。
Design Automation 的当前限制是模型保存只能保存到云计算机的当前工作目录中。这是因为用户应用程序被禁止访问网络。
因此,Design Automation 当前不支持 doc.SaveAsCloudModel()。也就是说,我们已注意到您对 Design Automation 中的 BIM 360 功能的请求!
谢谢,
迈克尔
我想将我的 Revit 文件上传到 BIM 360,并将其作为云模型进行处理。
我正在使用设计自动化 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
这很奇怪,因为当我 运行 Autodesk.Revit.DB.Document.SaveAsCloudModel()
方法时,作为 ExtrnalApplication
通过 Revit UI,一切正常。我只在设计自动化云上得到异常。
Design Automation 的当前限制是模型保存只能保存到云计算机的当前工作目录中。这是因为用户应用程序被禁止访问网络。
因此,Design Automation 当前不支持 doc.SaveAsCloudModel()。也就是说,我们已注意到您对 Design Automation 中的 BIM 360 功能的请求!
谢谢, 迈克尔