1

I have a Revit add-in (C#) that I've converted to run using the Design Automation API. I've followed the steps to convert and upload the app bundle as well as make the required input files cloud-available. I've submitted two work items (as tests) and although they seemed to be submitted successfully, when I check on their status it seems stuck on "inprogress". Strangely enough, the status check also includes the time finished field (response shown below).

{
    "status": "inprogress",
    "stats": {
        "timeQueued": "2020-09-29T00:20:36.1972128Z",
        "timeDownloadStarted": "2020-09-29T00:20:36.4647984Z",
        "timeFinished": "2020-09-29T00:20:36.5533134Z"
    },
    "id": "CENSORED"
}

When I run this code on the same input using my local machine, the actual processing time is quite quick (~1min). The input files required to be downloaded aren't large either (~15MB total).

My questions are:

  1. Is the timeFinished field with the status "inprogress" expected behaviour (it seems at odds with what is listed here: https://forge.autodesk.com/en/docs/design-automation/v3/reference/http/workitems-id-GET/)

  2. Any ideas on what might be happening?

Thank you for your time and attention.

P.S. It's probably worth mentioning that I've used the local debugging tool (https://github.com/Autodesk-Forge/design.automation-csharp-revit.local.debug.tool) to test the Design Automation version of my code locally and it works as expected.

Edit:

I'm using Revit 2020 and the work item id is: b66d0ab15d9648bb8e614f42995aedc5.

After waiting a night and checking on the item in the morning, the status has updated to "failedInstructions". However, upon looking at the error report it seems that the job is taking 3 hours (which I believe is the maximum time allowed for the job) to run before failing. I've attached some of the report.txt (note the time stamps):

[09/29/2020 02:04:22] Initializing RCE....
[09/29/2020 02:04:22] Initializing RevitCoreEngine (and possibly running stub installer)...
[09/29/2020 02:04:22] Language not specified, using English as default
[09/29/2020 02:04:26] Initialize and  get RCE: (VersionBuild) 20.0.0.0 (VersionNumber) 2020 (SubVersionNumber) 2020.2
[09/29/2020 05:04:17] Error: Application revitcoreconsole.exe exits with code -1 which indicates an error.
[09/29/2020 05:04:17] End script phase.
[09/29/2020 05:04:17] Error: An unexpected error happened during phase CoreEngineExecution of job.
[09/29/2020 05:04:17] Job finished with result FailedExecution
urandom
  • 153
  • 6
  • 1
    Which Revit version are you using? – Rahul Bhobe Sep 29 '20 at 03:07
  • 1
    @urandom If you could provide WorkItem Id, we may provide more information on what happened here. Thanks! :) – Emma Zhu Sep 29 '20 at 03:16
  • Thanks for the quick comments! – urandom Sep 29 '20 at 15:36
  • 2
    It seems your input is a `rte` file. Design Automation tries to open this template file, causing the hanging. We could make improvement here. As workaround, you could try not to provide "/i $(args[inputFile].path)" in the commandline, but open `rte` file in the addin by calling `Document doc = app.NewProjectDocument("my.rte");`. Hope it helps! – Emma Zhu Sep 29 '20 at 16:33
  • @EmmaZhu thanks for the tip. Unfortunately, when previously trying to post the activity definition without the /i etc I wasn't able to get a successful response. I tried following the command structure outlined here: https://forge.autodesk.com/blog/when-working-newprojectdocument-design-automation-api – urandom Sep 29 '20 at 17:11
  • @urandom, the blog should solve the problem here! May I ask what error you got for activity definition without `/i`? – Emma Zhu Sep 29 '20 at 18:31
  • @EmmaZhu upon remaking the app bundle and activity definition from scratch it seems to have resolved! Thanks for your help. At the risk of asking an additional question in the comments, one of my input files is a zip, however the folder that the zip is unpacked to seems to change every time. Is there a way to account for this? Thanks again for your help. – urandom Sep 29 '20 at 19:21
  • Glad the last issue is resolved! As for zip, yes, if there is no `localname` is provided, the folder that the zip is unpacked will be given a random name. You could assign the folder name wanted to be the localname for this zip input. More information can be found: [Forge doc](https://forge.autodesk.com/en/docs/design-automation/v3/reference/http/workitems-POST/#body-structure) `arguments-> * -> XrefTreeArgument->pathInZip` – Emma Zhu Sep 29 '20 at 19:42

0 Answers0