You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

APS环境中iLogic规则无法执行问题求助

装配体iLogic规则在Design Automation中未执行,无PDF输出

我在装配体文件中嵌入iLogic规则,用于更新参数、打开关联工程图并导出PDF以适配Design Automation场景,但规则运行异常,无输出返回至存储桶。

已遵循创建APS兼容iLogic规则的所有推荐步骤,包括为每个操作添加日志并尝试导出log.txt文件,但运行工作项时log.txt未生成,推测iLogic规则可能未执行。

错误报告

[11/15/2024 18:15:32] 作业信息:
{
  "CommandLine": [
    "$(engine.path)\\InventorCoreConsole.exe /i \"$(args[inputFile].path)\" \"$(args[InventorParams].path)\" /s \"$(settings[script].value)\" "
  ],
  "Settings": {
    "script": {
      "value": "iLogicVb.RunRule(\"MyRule\")"
    },
    "dasOpenNetwork": {
      "value": "true",
      "isEnvironmentVariable": true
    }
  },
  "Id": "c073a813e1584614b5b75968a321424d",
  "ActivityId": "y9RzOGD5tXcdhKNJpxpsSMsyqhNT4DnYSbAjOsli5hD7mt81.drawingautomation17+dev",
  "EngineId": "Autodesk.Inventor_2025!44",
  "Apps": [],
  "BoundArguments": {
    "inputFile": {
      "zip": true,
      "localName": "input",
      "pathInZip": "630AF.iam",
      "url": "https://developer.api.autodesk.com/Masked:X4NXLXxOZ3IZVhJalhri7cVVyMg=",
      "headers": {
        "Authorization": "Masked:LgiH6MHsvmMxrQRQh667CaFUblc="
      },
      "verb": "get"
    },
    "InventorParams": {
      "localName": "input\\params.json",
      "url": "https://developer.api.autodesk.com/Masked:jrcCsOry8tUPWxWaatYh0JInitA=",
      "headers": {
        "Authorization": "Masked:LgiH6MHsvmMxrQRQh667CaFUblc="
      },
      "verb": "get"
    },
    "outputFile": {
      "localName": "input\\630AF.pdf",
      "url": "https://developer.api.autodesk.com/Masked:QN/HWF0qHe+7jvWfMfNeYvxKghA=",
      "headers": {
        "Authorization": "Masked:LgiH6MHsvmMxrQRQh667CaFUblc="
      },
      "verb": "put"
    }
  },
  "Quotas": {
    "limitProcessingTimeSec": 900,
    "limitTotalUncompressedAppsSizeInMB": 500
  }
}
[11/15/2024 18:15:32] 开始工作项 c073a813e1584614b5b75968a321424d
[11/15/2024 18:15:32] 开始下载阶段。
[11/15/2024 18:15:32] 开始下载输入: 请求方法 - 'Get', URL - 'https://developer.api.autodesk.com/oss/v2/buckets/jcbucket1/objects/630AF.zip'
[11/15/2024 18:15:32] 开始下载输入: 请求方法 - 'Get', URL - 'https://developer.api.autodesk.com/oss/v2/buckets/jcbucket1/objects/params.json'
[11/15/2024 18:15:32] 下载文件完成。来源=https://developer.api.autodesk.com/oss/v2/buckets/jcbucket1/objects/params.json,本地文件=T:\Aces\Jobs\c073a813e1584614b5b75968a321424d\input\params.json,下载字节数=39,耗时=111ms
[11/15/2024 18:15:32] 下载文件完成。来源=https://developer.api.autodesk.com/oss/v2/buckets/jcbucket1/objects/630AF.zip,本地文件=T:\Aces\Jobs\c073a813e1584614b5b75968a321424d\zip_27.zip,下载字节数=7342731,耗时=266ms
[11/15/2024 18:15:32] T:\Aces\Jobs\c073a813e1584614b5b75968a321424d\zip_27.zip 已解压至文件夹 T:\Aces\Jobs\c073a813e1584614b5b75968a321424d\input。
[11/15/2024 18:15:32] 下载阶段成功结束。
[11/15/2024 18:15:32] 开始准备脚本和命令行参数。
[11/15/2024 18:15:32] 命令行: [ /i "T:\\Aces\\Jobs\\c073a813e1584614b5b75968a321424d\\input\\630AF.iam" "T:\\Aces\\Jobs\\c073a813e1584614b5b75968a321424d\\input\\params.json" /s "iLogicVb.RunRule(\"MyRule\")" ]
[11/15/2024 18:15:32] 准备脚本和命令行参数结束。
[11/15/2024 18:15:33] 开始脚本阶段。
[11/15/2024 18:15:33] 开始输出Inventor核心引擎标准日志。
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : InventorCoreConsole.exe: 25.0.18300.0, 3-27f3b8a
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 启动Inventor Server。
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 尝试获取当前使用的Inventor Server版本。
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : Inventor Server版本为 29.0.16200.0000。
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : Inventor Server版本为2023或更新版本
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 已启动Inventor Server 2025 (版本号290162000, 162) (29.0.16200.0000)
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 加载插件: iLogic Plugin
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 激活插件: iLogic Plugin
[11/15/2024 18:15:33] iLogic Plugin: 初始化中...
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 加载插件: iLogic Plugin
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 设置iLogicLogLevelTo: Warn
[11/15/2024 18:15:33] InventorCoreConsole.exe 信息: 0 : 打开文档: T:\Aces\Jobs\c073a813e1584614b5b75968a321424d\input\630AF.iam 不可见模式: False
[11/15/2024 18:15:36] InventorCoreConsole.exe 信息: 0 : 已打开
[11/15/2024 18:15:36] InventorCoreConsole.exe 信息: 0 : 加载插件: iLogic Plugin
[11/15/2024 18:15:36] InventorCoreConsole.exe 信息: 0 : 执行iLogic诊断...
[11/15/2024 18:15:36] InventorCoreConsole.exe 信息: 0 : iLogic诊断结束...
[11/15/2024 18:15:36] CoreConsole 开始释放资源
[11/15/2024 18:15:36] CoreConsole 开始释放所有对象
[11/15/2024 18:15:36] CoreConsole 释放所有对象结束
[11/15/2024 18:15:36] CoreConsole 释放资源结束
[11/15/2024 18:15:36] CoreConsole 退出 (0)
[11/15/2024 18:15:38] 结束输出Inventor核心引擎标准日志。
[11/15/2024 18:15:38] 脚本阶段结束。
[11/15/2024 18:15:38] 开始上传阶段。
[11/15/2024 18:15:38] 错误: 必填输出文件 [input\630AF.pdf] 缺失。
[11/15/2024 18:15:38] 错误: 作业发布阶段发生意外错误。
[11/15/2024 18:15:38] 作业执行完成,结果为 FailedMissingOutput
[11/15/2024 18:15:38] 作业状态:
{
  "status": "failedInstructions"
}

排查方向

  • 规则名称匹配:确认装配体中嵌入的iLogic规则名称确实为MyRule,Design Automation环境严格区分大小写,需完全匹配。
  • 环境兼容性检查:
    • 移除规则中所有UI交互类API(如弹窗、选择对话框),Design Automation为无头环境,不支持任何桌面Inventor的UI操作。
    • 所有文件路径使用绝对路径,通过ThisDoc.Path获取装配体目录,拼接工程图和PDF输出路径,避免依赖相对路径。
  • 日志配置优化:
    • 将iLogic日志级别调整为Info或Debug,可在Activity的Settings中添加ilogicLogLevel参数并设为Info,捕获更多执行细节。
    • 在规则开头添加手动日志写入代码,直接输出到作业目录(如System.IO.File.WriteAllText(Environment.GetEnvironmentVariable("ACES_JOB_DIR") & "\\log.txt", "规则启动")),确保日志文件生成。
  • 工程图关联验证:
    • 确认输入ZIP包包含所有关联工程图,且路径与装配体中的关联路径一致。
    • 在规则中添加工程图加载错误捕获,检查是否成功打开工程图,避免因加载失败导致PDF导出步骤中断。
  • 参数传递检查:验证params.json文件路径是否正确,在规则开头添加代码读取并验证参数内容,确保参数能被正确解析。

内容的提问来源于stack exchange,提问作者Jianchen Yu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 07:34:51