简体   繁体   English

带有 CustomExporter 插件的 Revit 设计自动化中的 FailedMissingOutput 错误

[英]FailedMissingOutput error In Design Automation for Revit with a CustomExporter plugin

I am trying to port a Revit plugin to design automation and keep running into failedInstructions error.我正在尝试将 Revit 插件移植到设计自动化并继续遇到 failedInstructions 错误。 It seems like the output file is missing:似乎缺少 output 文件:

[04/02/2020 23:29:05] Finished running.  Process will return: Success
[04/02/2020 23:29:05] ====== Revit finished running: revitcoreconsole ======
[04/02/2020 23:29:06] End Revit Core Engine standard output dump.
[04/02/2020 23:29:06] End script phase.
[04/02/2020 23:29:06] Start upload phase.
[04/02/2020 23:29:06] Error: Non-optional output [result.avr] is missing.
[04/02/2020 23:29:06] Error: An unexpected error happened during phase Publishing of job.
[04/02/2020 23:29:06] Job finished with result FailedMissingOutput
[04/02/2020 23:29:06] Job Status:

When I debug the build locally (following this ), the output file is in the sandbox folder at the end of the plugin run, so I am not sure what I am doing wrong.当我在本地调试构建时(在之后),output 文件位于插件运行结束时的沙箱文件夹中,所以我不确定我做错了什么。

The plugin basically is a CustomExporter and creates a binary file at the end of the export.该插件基本上是一个 CustomExporter,并在导出结束时创建一个二进制文件。 Is it possible that I am saving the file to the wrong location?是否有可能我将文件保存到错误的位置? How should I acquire the location where the output file should be saved?我应该如何获取output文件应该保存的位置? Currently this is how I acquire it:目前这是我获取它的方式:

string path = Path.GetDirectoryName(designAutomationData.FilePath);

I am not sure if that's the best way to do it, it does work though when I locally debug the build.我不确定这是否是最好的方法,但当我在本地调试构建时它确实有效。

Thanks!谢谢!

Here is the error report that I got after changing the activity config:这是我在更改活动配置后得到的错误报告:

[04/16/2020 22:53:18] Job information:
"CommandLine":[
  "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[AppliedVR2].path)"
]
"Settings":{
  "dasreportfailedlimits": {
    "value": "true",
    "isEnvironmentVariable": true
  }
}
"Id":"f8cd8a94406446378d9264575d78ab87"
"ActivityId":"AppliedVR.AppliedVRActivity+test"
"Engine.Id":"Autodesk.Revit!30"
"Apps": [
"App.Id":"AppliedVR.AppliedVR2!5"
]
"BoundArguments":{
  "rvtFile": {
    "localName": "input.rvt",
    "url": "https://developer.api.autodesk.com/Masked:UeVmt8Rd4DdQdOqq2M6OBzlRrIk="
  },
  "result": {
    "localName": "result.avr",
    "url": "https://developer.api.autodesk.com/Masked:lufOG0jY7w3wI4qgu2piEpfmJlE=",
    "verb": "put"
  },
  "onProgress": {
    "ondemand": true,
    "url": "https://wlnr5sjl3a.execute-api.us-east-1.amazonaws.com/Masked:UK/Z3b5X3xUWxXiH6C9r9i9UlRU=",
    "headers": {
      "Content-Type": "application/json",
      "x-das-authorize": "awssigv4(us-east-1)",
      "x-ads-token-data": "{\"access_token\":{\"client_id\":\"v6Y3fgoTmhViA3mDVLmGAD0vKIHoist4\"},\"scope\":\"code:all data:write data:read bucket:create bucket:delete\",\"expires_in\":3223,\"client_id\":\"v6Y3fgoTmhViA3mDVLmGAD0vKIHoist4\"}"
    },
    "verb": "put"
  }
}
"Quotas":{
  "limitDownloads": 200,
  "limitUploads": 200,
  "limitDownloadSizeMB": 2000,
  "limitUploadSizeMB": 2000,
  "limitProcessingTimeSec": 10800,
  "limitTotalUncompressedAppsSizeInMB": 5000
}
[04/16/2020 22:53:18] Starting work item f8cd8a94406446378d9264575d78ab87
[04/16/2020 22:53:18] Start preparing AppPackage AppliedVR2.
[04/16/2020 22:53:18] Download bits and install app to local cache.
[04/16/2020 22:53:18] Start download phase.
[04/16/2020 22:53:18] Start downloading file https://developer.api.autodesk.com/oss/v2/signedresources/bd22a42a-e4c6-46a3-a883-725fde437534?region=US.
[04/16/2020 22:53:19] End downloading file https://developer.api.autodesk.com/oss/v2/signedresources/bd22a42a-e4c6-46a3-a883-725fde437534?region=US. 17813504 bytes have been written to T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\input.rvt.
[04/16/2020 22:53:19] End download phase.
[04/16/2020 22:53:19] Start preparing script and command line parameters.
[04/16/2020 22:53:19] Command line: [ /i T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\input.rvt /al T:\Aces\Applications\de0b7681c6a14291e1f8079b595309bf.AppliedVR.AppliedVR2[5].package]
[04/16/2020 22:53:19] End preparing script and command line parameters.
[04/16/2020 22:53:19] Start script phase.
[04/16/2020 22:53:19] ### Command line arguments: /isolate HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_f8cd8a94406446378d9264575d78ab87 "T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\userdata" /exe "T:\Aces\AcesRoot\20.0\coreEngine\Exe\revitcoreconsole.exe"  /i T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\input.rvt /al T:\Aces\Applications\de0b7681c6a14291e1f8079b595309bf.AppliedVR.AppliedVR2[5].package.
[04/16/2020 22:53:19] Start Revit Core Engine standard output dump.
[04/16/2020 22:53:19] Running in unattended mode.
[04/16/2020 22:53:19] ====== Revit is running: revitcoreconsole ======
[04/16/2020 22:53:19] Current Exe path: T:\Aces\AcesRoot\20.0\coreEngine\Exe\revitcoreconsole.exe
[04/16/2020 22:53:19] Echoing command line args:
[04/16/2020 22:53:19]   0:/i
[04/16/2020 22:53:19]   1:T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\input.rvt
[04/16/2020 22:53:19]   2:/al
[04/16/2020 22:53:19]   3:T:\Aces\Applications\de0b7681c6a14291e1f8079b595309bf.AppliedVR.AppliedVR2[5].package
[04/16/2020 22:53:19]   4:/isolate
[04/16/2020 22:53:19]   5:HKEY_CURRENT_USER\SOFTWARE\AppDataLow\Software\Autodesk\CoreUser\WorkItem_f8cd8a94406446378d9264575d78ab87
[04/16/2020 22:53:19]   6:T:\Aces\Jobs\f8cd8a94406446378d9264575d78ab87\userdata
[04/16/2020 22:53:19] Running RevitAssemblyResolver....
[04/16/2020 22:53:19] Initializing RevitCoreEngine...
[04/16/2020 22:53:19] Selected Revit\RCE install Path: (from app.config) C:\Revit2020
[04/16/2020 22:53:19] Resolving location of Revit/RevitCoreEngine installation...
[04/16/2020 22:53:19] Running user application....
[04/16/2020 22:53:22] Found an addIn for registration: AppliedVR.addin
[04/16/2020 22:53:22] Initializing RCE....
[04/16/2020 22:53:22] Initializing RevitCoreEngine (and possibly running stub installer)...
[04/16/2020 22:53:22] Language not specified, using English as default
[04/16/2020 22:53:27] Initialize and  get RCE: (VersionBuild) 20.0.0.0 (VersionNumber) 2020 (SubVersionNumber) 2020.2
[04/16/2020 22:53:41] entering finishPlayback .. destroy m_PlaybackState

continuing finishPlayback .. destroy callStream()

exited finishPlayback

[04/16/2020 22:53:41] Finished running.  Process will return: Success
[04/16/2020 22:53:41] ====== Revit finished running: revitcoreconsole ======
[04/16/2020 22:53:42] End Revit Core Engine standard output dump.
[04/16/2020 22:53:42] End script phase.
[04/16/2020 22:53:42] Start upload phase.
[04/16/2020 22:53:42] Error: Non-optional output [result.avr] is missing.
[04/16/2020 22:53:42] Error: An unexpected error happened during phase Publishing of job.
[04/16/2020 22:53:42] Job finished with result FailedMissingOutput
[04/16/2020 22:53:42] Job Status:
{
  "status": "failedInstructions",
  "reportUrl": "https://dasprod-store.s3.amazonaws.com/workItem/AppliedVR/f8cd8a94406446378d9264575d78ab87/report.txt?AWSAccessKeyId=ASIATGVJZKM3BQBZQA5I&Expires=1587091998&x-amz-security-token=IQoJb3JpZ2luX2VjEJb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQC23btvW9Bcu1gNDXkzViJLprertbj9c7kxAy5PVJYRCwIhAPKWSZ3ZhMrrHdzJbBalII31HqBK28QVadpYVMf2P20RKt4BCK%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQARoMMjIwNDczMTUyMzEwIgy%2BO%2FAfOqk4DDr6iwIqsgG02AGNCa1FQ%2BdgFHLnhUGDdfEUS08GOiKhro71OlQ2SWFdklwJqB0CaZFqX5vRv8wrjuBwOY0j3h7lGisYWq1H95I3344cq3pARmaSnUUE2mEo3ccILj2uk3Lr3qrNvYTJxGgISNIn4c5yQ%2BocMDaSLVLpPSCsnP4zvkS8AxXWHS48WTTv6cLKqCBfL%2BxVga%2FM9nQ4NpwXfAKqNHvf5Ied5chHqAEUJqLWr6GgCpL%2F92AXMNif4%2FQFOt8B4Z7oymqrWokYXRjZ3d%2FHlZ17UXKA66w9ZZOdKl0%2BELpGn0DQE4nnRhdMFPpF4RNH4shTzMphSzxltjAmN%2BQCStFivM5u6HQMf0mHNGAx8lQUFX9Av2lJ%2BcD67GSNZjcW%2FeNvUG6huf2nhUTflYCGKMAkS%2FKhoxmALcaIGQc9u85%2FufPH7rzr%2FvrILpfFEqI6ThhluwegL0lsx9jZyXRkUCkTT9W8A5GaFI2%2BPgAoHrQRU%2FAwTfb%2BeCHoF3a0%2FG%2BqnIOTG1TFpmaeDIwqGnQpfF347YnE3Cto%2Bcjv2xUbcA%3D%3D&Signature=P%2B2FgQufC2CAXzd1v4P8VBy%2B82E%3D",
  "stats": {
    "timeQueued": "2020-04-16T22:53:17.8599944Z",
    "timeDownloadStarted": "2020-04-16T22:53:18.3570171Z",
    "timeInstructionsStarted": "2020-04-16T22:53:19.2091954Z",
    "timeInstructionsEnded": "2020-04-16T22:53:42.9536344Z",
    "timeUploadEnded": "2020-04-16T22:53:42.9540772Z",
    "bytesDownloaded": 17813504
  },
  "id": "f8cd8a94406446378d9264575d78ab87"
}

Please check your activity config, you may have a required: true parameter like the below.请检查您的活动配置,您可能有一个required: true参数,如下所示。 Therefore, to fix it, you must change it to required: false , and here is a tutorial for modifying existing activity config: https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step5-publish-activity/#step-3-update-an-existing-activity因此,要修复它,您必须将其更改为required: false ,这里是修改现有活动配置的教程: https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/ step5-publish-activity/#step-3-update-an-existing-activity

{
    "commandLine": [
        "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[DeleteWallsApp].path)"
    ],
    "parameters": {
        "rvtFile": {
            "verb": "get",
            "zip":false,
            "ondemand":false,
            "description": "Input Revit model",
            "required": true,
            "localName": "input.rvt"
        },
        "result": {
            "verb": "put",
            "description": "Results",
            "required": true,               //!<<< Here is the issue
            "localName": "result.avr"
        }
    },
    "engine": "Autodesk.Revit+2018",
    "appbundles": [
        "YOUR_NICKNAME.DeleteWallsApp+test"
    ],
    "description": "Delete walls from Revit file.",
    "version": 1,
    "id": "YOUR_NICKNAME.DeleteWallsActivity"
}

Update更新

Reflected on your activity body:反映在您的活动主体上:

{
    "commandLine": [
        "$(engine.path)\\\\revitcoreconsole.exe /i $(args[rvtFile].path) /al $(appbundles[AppliedVR2].path)"
    ],
    "parameters": {
        "rvtFile": {
            "localName": "input.rvt",
            "url": "https://developer.api.autodesk.com/Masked:UeVmt8Rd4DdQdOqq2M6OBzlRrIk="
        },
        "result": {
            "localName": "result.avr",
            "url": "https://developer.api.autodesk.com/Masked:lufOG0jY7w3wI4qgu2piEpfmJlE=",
            "required": false,              //!<<< Add this line if there is no result.avr produced after task completed
            "verb": "put"
        }
    },
    "engine": "Autodesk.Revit+2020",
    "appbundles": [
        "AppliedVR.AppliedVR2"
    ],
    "description": "YOU_COMMENTS_HERE",
    "version": 5,
    "id": "AppliedVR.AppliedVRActivity+test"
}

Ok I did a little more experimenting, and fixed the issue.好的,我做了更多的实验,并解决了这个问题。 I had some operations that I executed on background threads, none of which interacted with Revit API.我在后台线程上执行了一些操作,但没有一个与 Revit API 交互。 They work fine when I run the plugin locally, but I assume I cannot use background threads on Forge.当我在本地运行插件时它们工作正常,但我假设我不能在 Forge 上使用后台线程。 I would have expected that to show up as an error in the log though.我本来希望这会在日志中显示为错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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