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

Creo钣金文件导入APS后SurfaceBodies.Count为零的问题求助

问题:APS环境下读取Creo钣金文件无法获取正确的曲面体数量

我在将Creo钣金文件加载到APS应用时遇到了一个问题:无法从SheetMetalComponentDefinition对象中获取正确的曲面体数量,返回值始终为0,但本地使用安装的Inventor实例运行时一切正常。

核心代码

获取曲面体数量的逻辑:

SheetMetalComponentDefinition scd = (SheetMetalComponentDefinition)partDocument.ComponentDefinition;
var bCount = scd.SurfaceBodies.Count;

两种环境的初始化代码差异

  • 本地Inventor环境:通过以下方式初始化InventorServer,执行后能得到有效的曲面体计数:
InventorServer server = inv.GetInventorServer();
  • APS云端环境:通过插件的Activate方法初始化InventorServer,此时SurfaceBodies.Count返回0:
public void Activate(ApplicationAddInSite addInSiteObject, bool firstTime)
{
    Trace.TraceInformation(": UpdateIPTParam (" + Assembly.GetExecutingAssembly().GetName().Version.ToString(4) + "): initializing... ");

    // Initialize AddIn members.
    _inventorServer = addInSiteObject.InventorServer;
    Automation = new SampleAutomation(_inventorServer);
}

已准备好示例Creo测试文件,恳请各位提供排查思路或解决方案,谢谢!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.12 22:52:06