我正在尝试使用设计自动化 API 的 v2 和forge-api-nodejs-client
. WorkItem 将 json 文件作为输入参数。我创建的自定义 .NET 插件取决于 json 文件。
WorkItem 由于FailedMissingOutput
. 我打印了报告并注意到了这一点...
[02/11/2019 19:14:48] Command: DRAWMARKUPS
[02/11/2019 19:14:49] ************************MessageBox****************************
[02/11/2019 19:14:49] AutoCAD Error Aborting
[02/11/2019 19:14:49] FATAL ERROR: Unhandled Access Violation Reading 0x0008 Exception at 82480c14h
[02/11/2019 19:14:49] >>>Responding: OK.
[02/11/2019 19:14:49] **************************************************************
[02/11/2019 19:14:49] ************************MessageBox****************************
[02/11/2019 19:14:49] AutoCAD Error-abort
[02/11/2019 19:14:49] Error handler re-entered. Exiting now.
[02/11/2019 19:14:49] >>>Responding: OK.
[02/11/2019 19:14:49] **************************************************************
[02/11/2019 19:14:49] End AutoCAD Core Engine standard output dump.
[02/11/2019 19:14:50] Error: AutoCAD Core Console output contains error(s).
[02/11/2019 19:14:50] End script phase.
[02/11/2019 19:14:50] Start upload phase.
[02/11/2019 19:14:50] Error: Non-optional output [a57863c8-3085-4bc2-90b6-709595f1c566.dwg.dwg] is missing .
[02/11/2019 19:14:50] Error: An unexpected error happened during phase Publishing of job.
[02/11/2019 19:14:50] Job finished with result FailedMissingOutput
这是我的 .NET 插件中可能会破坏它的行...
string drawingName = Path.GetFileName(acDoc.Name);
...
// Read input parameters from JSON file
JArray jArray = JArray.Parse(File.ReadAllText("markups.json"));
...
acCurDb.SaveAs(drawingName, DwgVersion.AC1027);
CommandLineParameters
另外,我的活动定义中没有包含任何Instruction
对象。
const activityObject = {
id: id,
instruction: {
CommandLineParameters: null,
Script: `${script}`
},
appPackages: appPackages,
requiredEngineVersion: `20.1`,
parameters: {
InputParameters: [{
Name: `HostDwg`,
LocalFileName: `$(HostDwg)`
}],
OutputParameters: [{
Name: outPutFilename,
LocalFileName: `${outPutFilename}.dwg`
}]
},
allowedChildProcesses: [],
version: 1,
isPublic: true,
theData: null,
obj: null
};
我怀疑CommandLineParameters
我的活动定义中缺少权利,但我不知道应该是什么。
为什么我的 WorkItem 失败了?是Activity还是插件?而且,我该如何解决这个问题?
更新:我修正.dwg.dwg
了输出文件名中的错字。现在 WorkItem 成功了,但我仍然收到Unhandled Access Violation
错误消息。此外,我的脚本似乎没有在 json 文件中读取。该插件在本地工作,所以我仍然不知道发生了什么。