zoukankan      html  css  js  c++  java
  • Teamcenter中TCComponentItem与TCComponentBOMLine的创建

    1:在teamcenter中创建零组件对象:直接上方法

    TCSession session = (TCSession) AIFUtility.getDefaultSession();  //获取tcsession
    public TCComponentItem createItem(TCSession session, String type,String itemID, String itemName, String itemRev) throws TCException {
    //type是"Item",itemID是零组件id,itemName是零组件名字,itemRev是零组件版本
    TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent(type);
    /根据零组件信息创建零组件对象
    TCComponentItem  item = itemType.create(itemID,intmRev, type, itemName, "", null);
    //item = itemType.find(itemID);  //可以根据零组件id查询tc中有没有这个零组件对象
    版权声明:本文为CSDN博主「叮当LIU」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_36880602/article/details/78259443
    

     2:在teamcenter中创建BOMLine对象:

    public TCComponentBOMLine addBOMLine(TCSession session,
    TCComponentItem parentItem, TCComponentItem childrenItem) throws TCException {
    //prantItem是父零组件对象,childrenItem是子零组件对象
    TCComponentBOMLine bomline = null;
    TCComponentBOMWindowType winType = (TCComponentBOMWindowType) session.getTypeComponent("BOMWindow");
    TCComponentBOMWindow window = winType.create(null);
    window.lock();
    TCComponentBOMLine topLine = window.setWindowTopLine(parentItem,parentItem.getLatestItemRevision(), null, null);
    bomline = topLine.add(childrenItem,childrenItem.getLatestItemRevision(), null, false, "");
    topLine.save();
    window.save();
    window.unlock();
    window.close();
    return bomline;
    }
    ————————————————
    版权声明:本文为CSDN博主「叮当LIU」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_36880602/article/details/78259443
    

      

  • 相关阅读:
    SqlHelper使用详解
    c# 分布式事务以及MSDTC
    DataGridView隔行显示不同的颜色
    C# WinForm开发系列 DataGridView
    使用SQLHelper类调用带输出、返回参数的存储过程
    MySQLHelper类使用说明
    搜索页面———心得
    侨光卡路网站的工作点滴记录
    服务地图功能的开发心得
    成功项目经理手册
  • 原文地址:https://www.cnblogs.com/wwssgg/p/14705539.html
Copyright © 2011-2022 走看看