简体   繁体   中英

How to save Revit file in BIM 360 as cloud model using Forge Design Automation API?

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.

It is a current limitation of Design Automation that model saves can only be done into the current working directory of the cloud machine. This is because user apps are forbidden from accessing the network.

As such, doc.SaveAsCloudModel() is not currently supported on Design Automation. That said, we have noted your request for BIM 360 functionality in Design Automation!

Thanks, Michael

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM