I would like to upload my Revit file to BIM 360, and work on it as a cloud model.
I am using Design Automation API in order to do that.
For some reason I get an error that says: "Could not obtain entitlement server"
This is my AppBundle code:
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");
}
}
After I create the WorkItem, its status becomes "failedInstructions"
.
This is the exception log report it produces:
[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
This is very strange, because when I run the Autodesk.Revit.DB.Document.SaveAsCloudModel()
method, as an ExtrnalApplication
through Revit UI, everything works perfectly. I get the exception only on Design Automation cloud.