APS Configurator无法找到实体:签名曲面识别异常求助
错误信息
Details: Autodesk.iLogic.InventorHostException: GetIntent: No drawing curves found for entity "Plaszczyzna1" in component "DELTA_CORNER_PUSZKA, BLACHA_SRODEK" in view "A".
[11/06/2023 10:57:02] Exception of type 'Autodesk.iLogic.NoDrawingCurvesException' was thrown.
[11/06/2023 10:57:02] at Autodesk.iLogic.Core.ManagedDrawing.GeometryIntentHelper.GetGeometryIntent(DrawingView view, String parameterName, Boolean mayReturnCenterMark, Centermark& outCM)
[11/06/2023 10:57:02] at Autodesk.iLogic.Core.ManagedDrawing.ManagedDrawingView.GetIntent(ComponentArgument component, String entityName, PointIntentEnum intent, CurveChoiceSpec nearPoint)
[11/06/2023 10:57:02] at ThisRule.Main()
[11/06/2023 10:57:02] at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
[11/06/2023 10:57:02] at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
[11/06/2023 10:57:02] InventorCoreConsole.exe Error: 0 : iLogic error
涉及代码
'[ widok A Dim Plaszczyzna1 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_FRONT"}, "Plaszczyzna1") Dim Krawedz5 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_LEWA_PRAWA" }, "Krawedz5") polozenieWymiaruWidokA_1 = oTG.CreatePoint2d((WIDOKA.Center.X) / 10, (WIDOKA.Center.Y) / 10 + 3) Dim linDim3 = genDims.AddLinear(polozenieWymiaruWidokA_1, Plaszczyzna1, Krawedz5) Dim Plaszczyzna2 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_FRONT" }, "Plaszczyzna1") Dim Plaszczyzna3 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_SRODEK"}, "Plaszczyzna1") polozenieWymiaruWidokA_2 = oTG.CreatePoint2d((WIDOKA.Center.X) / 10, (WIDOKA.Center.Y) / 10 - 3) Dim linDim4 = genDims.AddLinear(polozenieWymiaruWidokA_2, Plaszczyzna2, Plaszczyzna3) Dim Krawedz6 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_LEWA_PRAWA"}, "Krawedz4") Dim Krawedz7 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_LEWA_PRAWA" }, "Krawedz6")
解决方案
1. 确保曲面在视图中生成有效投影
- 打开本地Inventor工程图,切换视图A为线框显示模式,确认
BLACHA_SRODEK组件的Plaszczyzna1曲面有可见的投影曲线。 - 检查视图A的组件可见性设置,确保
BLACHA_SRODEK未被隐藏。 - 保存工程图和关联零件后,重新上传至APS并刷新视图。
2. 替换曲面为边界边创建尺寸
曲面投影在APS环境中兼容性较差,建议改用曲面的边界边作为尺寸参考:
' 替换原Plaszczyzna3的获取逻辑,使用曲面对应的边界边 Dim KrawedzBound = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_SRODEK"}, "对应边界边的名称") Dim linDim4 = genDims.AddLinear(polozenieWymiaruWidokA_2, Plaszczyzna2, KrawedzBound)
3. 添加错误捕获逻辑
在代码中加入异常处理,避免规则因单个实体查找失败而崩溃:
Dim Plaszczyzna3 As GeometryIntent Try Plaszczyzna3 = WIDOKA.GetIntent({"DELTA_CORNER_PUSZKA", "BLACHA_SRODEK"}, "Plaszczyzna1") polozenieWymiaruWidokA_2 = oTG.CreatePoint2d((WIDOKA.Center.X) / 10, (WIDOKA.Center.Y) / 10 - 3) Dim linDim4 = genDims.AddLinear(polozenieWymiaruWidokA_2, Plaszczyzna2, Plaszczyzna3) Catch ex As Autodesk.iLogic.NoDrawingCurvesException Logger.Error("查找BLACHA_SRODEK的Plaszczyzna1失败: " & ex.Message) ' 可添加跳过逻辑或替代方案 End Try
4. 对齐APS与本地Inventor环境
- 确认APS使用的Inventor核心版本与本地Inventor版本一致,版本差异可能导致API行为不一致。
- 在APS中重新生成视图A,强制刷新所有组件的投影数据。
内容的提问来源于stack exchange,提问作者Mateusz Baczewski

