我正在尝试在自动化 API 中执行 iLogic 脚本。该模型并不小,因此我将其作为单个 24MB zip 文件上传。这是我的活动的样子:
{
"commandLine": [
"$(engine.path)\\InventorCoreConsole.exe /i \"$(args[inputFile].path)\" /s \"$(args[iLogicVb].path)\""
],
"parameters": {
"iLogicVb": {
"verb": "get",
"localName": "input.iLogicVb"
},
"outputFile": {
"verb": "put",
"localName": "output.pdf"
},
"inputFile": {
"verb": "get",
"zip": true
}
},
"id": "<myidhere>",
"engine": "Autodesk.Inventor+2021",
"appbundles": [],
"description": "Running iLogic Rule"
}
这就是我的 Workitem 的样子:
{
"activityId": "<myidhere>",
"arguments": {
"outputFile": {
"verb": "put",
"localName": "output.pdf",
"url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
"headers": {
"Content-type": "application/octet-stream",
"Authorization": "..."
}
},
"inputFile": {
"verb": "get",
"pathInZip": "<assembly name>.iam",
"url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
"headers": {
"Content-type": "application/octet-stream",
"Authorization": "..."
}
},
"iLogicVb": {
"url": "https://developer.api.autodesk.com/oss/v2/buckets/...",
"verb": "get",
"localName": "input.iLogicVb",
"headers": {
"Content-type": "application/octet-stream",
"Authorization": "..."
}
}
}
}
iLogic 代码非常简单:
Trace.WriteLine ("Starting rules")
ObjectWidth = 4 ft
ObjectHeight = 7 ft
Trace.WriteLine ("Saving PDF")
oDoc.SaveAs("output.pdf", true)
Trace.WriteLine ("Done")
根据执行报告,zip文件已成功下载并解压缩,但随后出现问题:
[07/29/2021 01:48:58] Starting work item 9b0e77a3f2d14d21b09d2eaee7652a81
[07/29/2021 01:48:58] Start download phase.
[07/29/2021 01:48:58] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/input.iLogicVb'
[07/29/2021 01:48:58] Start downloading input: verb - 'GET', url - 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/....zip'
[07/29/2021 01:48:58] '304' bytes have been written to T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\input.iLogicVb.
[07/29/2021 01:48:58] End downloading file from 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/input.iLogicVb'.
[07/29/2021 01:48:59] '24085650' bytes have been written to T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\zip_112.zip.
[07/29/2021 01:48:59] End downloading file from 'https://developer.api.autodesk.com/oss/v2/buckets/.../objects/....zip'.
[07/29/2021 01:49:00] T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\zip_112.zip has been unpacked to folder T:\Aces\Jobs\9b0e77a3f2d14d21b09d2eaee7652a81\unpack_folder_113.
[07/29/2021 01:49:00] End download phase successfully.
[07/29/2021 01:49:00] Start preparing script and command line parameters.
[07/29/2021 01:49:00] Error: The 'path2' is not defined.
[07/29/2021 01:49:00] Error: An unexpected error happened during phase CoreEngineExecution of job.
[07/29/2021 01:49:00] Job finished with result FailedExecution
这The 'path2' is not defined
绝对是一个神秘的、不可搜索的错误。什么可能导致它?也许有一个标志可以增加输出的详细程度以查看更多信息?