0

I'm using Forge's design automation API to translate Revit to IFC files. In some (important: not all) Revit files, I'm hitting the following problem:

model-extractor_1          | [02/25/2020 10:50:58] Running in unattended mode.
model-extractor_1          | [02/25/2020 10:50:58] ====== Revit is running: revitcoreconsole ======
model-extractor_1          | [02/25/2020 10:50:58] Current Exe path: T:\Aces\AcesRoot\19.0\coreEngine\Exe\revitcoreconsole.exe
model-extractor_1          | [02/25/2020 10:50:58] Echoing command line args:
model-extractor_1          | [02/25/2020 10:50:58]   0:/i
model-extractor_1          | [02/25/2020 10:50:58]   1:T:\Aces\Jobs\16c21feb781e44539b20f0b32384730c\5e54fbc67a40b70023fb77a7.rvt
model-extractor_1          | [02/25/2020 10:50:58]   2:/al
model-extractor_1          | [02/25/2020 10:50:58]   3:T:\Aces\Applications\04530640f3854e51106296c1bad8c4d8.RvtPreprocess.RvtPreprocess5[1].package
model-extractor_1          | [02/25/2020 10:50:58]   4:/isolate
model-extractor_1          | [02/25/2020 10:50:58]   5:HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_16c21feb781e44539b20f0b32384730c
model-extractor_1          | [02/25/2020 10:50:58]   6:T:\Aces\Jobs\16c21feb781e44539b20f0b32384730c\userdata
model-extractor_1          | [02/25/2020 10:50:58] Running RevitAssemblyResolver....
model-extractor_1          | [02/25/2020 10:50:58] Initializing RevitCoreEngine...
model-extractor_1          | [02/25/2020 10:50:58] Selected Revit\RCE install Path: (from app.config) C:\Revit2019
model-extractor_1          | [02/25/2020 10:50:58] Resolving location of Revit/RevitCoreEngine installation...
model-extractor_1          | [02/25/2020 10:50:58] Running user application....
model-extractor_1          | [02/25/2020 10:51:01] Found an addIn for registration: RvtPreprocess.addin
model-extractor_1          | [02/25/2020 10:51:01] Initializing RCE....
model-extractor_1          | [02/25/2020 10:51:01] Initializing RevitCoreEngine (and possibly running stub installer)...
model-extractor_1          | [02/25/2020 10:51:01] Language not specified, using English as default
model-extractor_1          | [02/25/2020 10:51:02] Initialize and  get RCE: (VersionBuild) 19.0.0.0 (VersionNumber) 2019 (SubVersionNumber) 2019.2
model-extractor_1          | [02/25/2020 10:52:58] Finished running.  Process will return: Success
model-extractor_1          | [02/25/2020 10:52:58] ====== Revit finished running: revitcoreconsole ======
model-extractor_1          | [02/25/2020 10:53:00] End Revit Core Engine standard output dump.
model-extractor_1          | [02/25/2020 10:53:00] End script phase.
model-extractor_1          | [02/25/2020 10:53:00] Start upload phase.
model-extractor_1          | [02/25/2020 10:53:00] Error: Non-optional output [result.ifc] is missing .
model-extractor_1          | [02/25/2020 10:53:00] Error: An unexpected error happened during phase Publishing of job.
model-extractor_1          | [02/25/2020 10:53:00] Job finished with result FailedMissingOutput
model-extractor_1          | [02/25/2020 10:53:00] Job Status:

This is odd as I make sure to prepare an upload url. This is evident as some files do succeed.

My workItem flow/code looks similar to:

        const downloadUrl = (await this.dataManagementClient.createSignedUrl(this.params.forgeBucket, shortName)).signedUrl;
        const uploadUrl = (await this.dataManagementClient.createSignedUrl(this.params.forgeBucket, uuid4(), 'readwrite')).signedUrl;
        const workItem = await this.designAutomationClient.createWorkItem(
            'RvtPreprocess.RvtPreprocessActivity5+test',
            {
                rvtFile: {
                    url: downloadUrl,
                    pathInZip: shortName,
                },
                result: {
                    verb: "put",
                    url: uploadUrl
                }
            }
        )

Any hints?

Edit:

Job information logs:

model-extractor_1          | [02/25/2020 11:14:52] Job information:
model-extractor_1          | "CommandLine":[
model-extractor_1          |   "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[RvtPreprocess5].path)"
model-extractor_1          | ]
model-extractor_1          | "Settings":{
model-extractor_1          |   "dasreportfailedlimits": {
model-extractor_1          |     "value": "true",
model-extractor_1          |     "isEnvironmentVariable": true
model-extractor_1          |   }
model-extractor_1          | }
model-extractor_1          | "Id":"b028fe12c5b943d48356a5738f743153"
model-extractor_1          | "ActivityId":"RvtPreprocess.RvtPreprocessActivity5+test"
model-extractor_1          | "Engine.Id":"Autodesk.Revit!29"
model-extractor_1          | "Apps": [
model-extractor_1          | "App.Id":"RvtPreprocess.RvtPreprocess5!1"
model-extractor_1          | ]
model-extractor_1          | "BoundArguments":{
model-extractor_1          |   "rvtFile": {
model-extractor_1          |     "localName": "$(rvtFile)",
model-extractor_1          |     "pathInZip": "5e5501747a40b70023fb77a9.rvt",
model-extractor_1          |     "url": "https://developer.api.autodesk.com/Masked:+A9horix/Nh5wX8c2fmP0d+60CE="
model-extractor_1          |   },
model-extractor_1          |   "result": {
model-extractor_1          |     "localName": "result.ifc",
model-extractor_1          |     "url": "https://developer.api.autodesk.com/Masked:4bpSamXnp/wNDyhX7oGp+5oCMo4=",
model-extractor_1          |     "verb": "put"
model-extractor_1          |   },
model-extractor_1          |   "onProgress": {
model-extractor_1          |     "ondemand": true,
model-extractor_1          |     "url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Masked:UK/Z3b5X3xUWxXiH6C9r9i9UlRU=",
model-extractor_1          |     "headers": {
model-extractor_1          |       "Content-Type": "application/json",
model-extractor_1          |       "x-das-authorize": "awssigv4(us-east-1)",
model-extractor_1          |       "x-ads-token-data": "{\"access_token\":{\"client_id\":\"TqUUZ0ZZFm3cK8BU8ROHdX4gt99mzkUl\"},\"scope\":\"code:all\",\"expires_in\":3599,\"client_id\":\"TqUUZ0ZZFm3cK8BU8ROHdX4gt99mzkUl\"}"
model-extractor_1          |     },
model-extractor_1          |     "verb": "put"
model-extractor_1          |   }
model-extractor_1          | }
model-extractor_1          | "Quotas":{
model-extractor_1          |   "limitDownloads": 200,
model-extractor_1          |   "limitUploads": 200,
model-extractor_1          |   "limitDownloadSizeMB": 2000,
model-extractor_1          |   "limitUploadSizeMB": 2000,
model-extractor_1          |   "limitProcessingTimeSec": 10800,
model-extractor_1          |   "limitTotalUncompressedAppsSizeInMB": 5000
model-extractor_1          | }

Edit 2:

Here's an example of a working translation. Exact same flow/code; different Revit file:

[02/25/2020 11:58:12] ====== Revit is running: revitcoreconsole ======
[02/25/2020 11:58:12] Current Exe path: T:\Aces\AcesRoot\19.0\coreEngine\Exe\revitcoreconsole.exe
[02/25/2020 11:58:12] Echoing command line args:
[02/25/2020 11:58:12]   0:/i
[02/25/2020 11:58:12]   1:T:\Aces\Jobs\1631ee152e2248409f5ef6e0299e968a\5e550bc17a40b70023fb77ab.rvt
[02/25/2020 11:58:12]   2:/al
[02/25/2020 11:58:12]   3:T:\Aces\Applications\04530640f3854e51106296c1bad8c4d8.RvtPreprocess.RvtPreprocess5[1].package
[02/25/2020 11:58:12]   4:/isolate
[02/25/2020 11:58:12]   5:HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_1631ee152e2248409f5ef6e0299e968a
[02/25/2020 11:58:12]   6:T:\Aces\Jobs\1631ee152e2248409f5ef6e0299e968a\userdata
[02/25/2020 11:58:12] Running RevitAssemblyResolver....
[02/25/2020 11:58:12] Initializing RevitCoreEngine...
[02/25/2020 11:58:12] Selected Revit\RCE install Path: (from app.config) C:\Revit2019
[02/25/2020 11:58:12] Resolving location of Revit/RevitCoreEngine installation...
[02/25/2020 11:58:12] Running user application....
[02/25/2020 11:58:16] Found an addIn for registration: RvtPreprocess.addin
[02/25/2020 11:58:16] Initializing RCE....
[02/25/2020 11:58:16] Initializing RevitCoreEngine (and possibly running stub installer)...
[02/25/2020 11:58:16] Language not specified, using English as default
[02/25/2020 11:58:17] Initialize and  get RCE: (VersionBuild) 19.0.0.0 (VersionNumber) 2019 (SubVersionNumber) 2019.2
[02/25/2020 11:58:29] Finished running.  Process will return: Success
[02/25/2020 11:58:29] ====== Revit finished running: revitcoreconsole ======
[02/25/2020 11:58:29] QWaitCondition: Destroyed while threads are still waiting
[02/25/2020 11:58:30] End Revit Core Engine standard output dump.
[02/25/2020 11:58:30] End script phase.
[02/25/2020 11:58:30] Start upload phase.
[02/25/2020 11:58:30] Uploading T:\Aces\Jobs\1631ee152e2248409f5ef6e0299e968a\result.ifc to https://developer.api.autodesk.com/oss/v2/signedresources/39644f58-8268-49ea-a945-5e8683592ebb?region=US.
[02/25/2020 11:58:30] End upload phase.
[02/25/2020 11:58:30] Job finished with result Succeeded
[02/25/2020 11:58:30] Job Status:

Edit 3:

Here's a code snippet from the script that writes to the file:

public static void ExportFunc(DesignAutomationData data){
    //some code
    var path_dir = Path.GetDirectoryName(data.FilePath);
    doc.Export(path_dir, "result.ifc", opt);
}

Seems like it's basic enough to work consistently, regardless of the content of the file.

Could it be that the process is a silent false positive, resulting in no file to be uploaded without Revit knowing?

leongold
  • 1,004
  • 7
  • 14
  • Could you provide working example of your problem ??? – SkorpEN Feb 25 '20 at 11:52
  • @SkorpEN please see the edited post. – leongold Feb 25 '20 at 12:03
  • Providing working example that show your problem in simplified version increase chance of finding correct answer. Optimal would be with data that reproduce error. It could be project hosted somewhere or git adress. It could be simplified version without credentials. – SkorpEN Feb 25 '20 at 12:13
  • You have the complete `workItem` creation code. This is sufficient (the only missing variable is `shortName`). Obviously I can't upload the different drawings as they're very much proprietary. – leongold Feb 25 '20 at 12:31

1 Answers1

0

This error happen because there was no file named "result.ifc" when your workitem reached the upload phase (once Revit is done executing). Since you have defined a non optional output for this file, your workitem finished in error. The next step would be to debug your addIn/workitem code to make sure a result.ifc file is always generated at the right place.

Jeremy
  • 357
  • 1
  • 6
  • How is this aligned with the fact only some drawings fail? "there was no file named "result.ifc" when your workitem reached the upload phase (once Revit is done executing)." also seems like an oxymoron since Revit can only possibly be done executing after it creates "result.ifc". – leongold Feb 25 '20 at 14:01
  • Could this happen, if for instance, the underlying script fails, Revit not being aware of the failure, setting the job's status to complete? (causing upload to fail as there's indeed no file generate) – leongold Feb 25 '20 at 14:08
  • It is possible, my knowledge of Revit is quite limited (sorry) . I am not too sure what might cause Revit to not produce the file but a failure in the script seems like a good suspect. – Jeremy Feb 25 '20 at 15:51
  • @leongold - there isn't enough information for me to pinpoint the issue. Since the code works for some files and do not for some, I suspect that Export probably fails for those input files. You can print the status of the export like shown below and they will show up in your logs: ``` public static void ExportFunc(DesignAutomationData data){ //some code var path_dir = Path.GetDirectoryName(data.FilePath); var result = doc.Export(path_dir, "result.ifc", opt); Console.WriteLine($"The export result = {result}"); } ``` – Rahul Bhobe Feb 25 '20 at 17:49
  • You can also try to debug your addin locally: https://forge.autodesk.com/blog/design-automation-debug-revit-plugin-locally – Rahul Bhobe Feb 25 '20 at 17:49
  • Yes, please debug it locally as suggested by Rahul to see what exactly happen to export Ifc file. – Zhong Wu Feb 26 '20 at 08:46