我正在尝试发布一个使用设计自动化API的v2和forge-api-nodejs-client
的WorkItem。WorkItem接受json文件作为输入参数。我创建的自定义.NET插件依赖于json文件。
由于FailedMissingOutput
,WorkItem失败。我把报告打印出来并注意到这一点。
[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);
另外,我没有在我的Activity的定义中包含Instruction
对象中的任何CommandLineParameters
。
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失败了?是活动,还是插件?那么,我该如何解决这个问题呢?
更新:我修复了输出文件名中的.dwg.dwg
拼写错误。现在WorkItem成功了,但我仍然得到Unhandled Access Violation
错误。而且,我的脚本似乎没有在json文件中读取。插件在本地工作,所以我仍然不知道是怎么回事。
发布于 2019-02-12 05:44:53
我建议你在你的.net插件中添加更多的日志记录,这样你就可以三角测量这个问题了。您可以使用简单的Console.WriteLine方法,它们将出现在您的报告中。您可能希望捕获异常并将其转储出去,以便知道失败的原因。
markup.json是从哪里来的?那是你的AppPackage压缩的一部分吗?
我不认为CommandLineParameters
在这里扮演任何角色。对于使用accoreconsole.exe的活动,您可以将其留空。我们将默认它。
https://stackoverflow.com/questions/54638439
复制相似问题