使用CustomExporter插件的Design Automation for Revit中出现FailedMissi



我正在尝试将Revit插件移植到设计自动化中,并一直运行到failedInstructions错误。输出文件似乎丢失了:

[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:

当我在本地调试构建时(如下(,输出文件在插件运行结束时位于沙盒文件夹中,所以我不确定我做错了什么。

该插件基本上是一个CustomExporter,并在导出结束时创建一个二进制文件。是否可能是我将文件保存到了错误的位置?我应该如何获取应该保存输出文件的位置?目前这是我获得它的方式:

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

我不确定这是否是最好的方法,不过当我在本地调试构建时,它确实有效。

谢谢!

这是我在更改活动配置后得到的错误报告:

[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:AcesJobsf8cd8a94406446378d9264575d78ab87input.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:AcesJobsf8cd8a94406446378d9264575d78ab87input.rvt /al T:AcesApplicationsde0b7681c6a14291e1f8079b595309bf.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_USERSOFTWAREAppDataLowSoftwareAutodeskCoreUserWorkItem_f8cd8a94406446378d9264575d78ab87 "T:AcesJobsf8cd8a94406446378d9264575d78ab87userdata" /exe "T:AcesAcesRoot20.0coreEngineExerevitcoreconsole.exe"  /i T:AcesJobsf8cd8a94406446378d9264575d78ab87input.rvt /al T:AcesApplicationsde0b7681c6a14291e1f8079b595309bf.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:AcesAcesRoot20.0coreEngineExerevitcoreconsole.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:AcesJobsf8cd8a94406446378d9264575d78ab87input.rvt
[04/16/2020 22:53:19]   2:/al
[04/16/2020 22:53:19]   3:T:AcesApplicationsde0b7681c6a14291e1f8079b595309bf.AppliedVR.AppliedVR2[5].package
[04/16/2020 22:53:19]   4:/isolate
[04/16/2020 22:53:19]   5:HKEY_CURRENT_USERSOFTWAREAppDataLowSoftwareAutodeskCoreUserWorkItem_f8cd8a94406446378d9264575d78ab87
[04/16/2020 22:53:19]   6:T:AcesJobsf8cd8a94406446378d9264575d78ab87userdata
[04/16/2020 22:53:19] Running RevitAssemblyResolver....
[04/16/2020 22:53:19] Initializing RevitCoreEngine...
[04/16/2020 22:53:19] Selected RevitRCE 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"
}

请检查您的活动配置,您可能有一个required: true参数,如下所示。因此,要修复它,必须将其更改为required: false,下面是修改现有活动配置的教程:https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step5-publish-activity/#step-3-更新-扩展活动

{
"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"
}

更新

反映在你的活动身体上:

{
"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"
}

好的,我做了更多的实验,解决了这个问题。我在后台线程上执行了一些操作,其中没有一个操作与Revit API交互。当我在本地运行插件时,它们工作得很好,但我认为我不能在Forge上使用后台线程。不过,我本以为这会在日志中显示为一个错误。

最新更新