zoukankan      html  css  js  c++  java
  • 替代件操作

    1、添加替代件的方法

      TCComponentBomLine.add(null, substituteItemRev, null, true);

    2、移除替代件

    public void removelAllSubstitutes(TCComponentBOMLine bomLine) throws TCException{
    		TCComponentItemRevision itemRev = bomLine.getItemRevision();
    		TCComponent[] tccomps3 = itemRev.whereUsed(TCComponentItemRevision.WHERE_USED_ALL);
    		for(TCComponent tcCom : tccomps3){
    			TCComponentItemRevision itemRevIndex = (TCComponentItemRevision) tcCom;
    			TCComponentBOMLine parentBomLine = BOMUtil.getInstance().createWindow().setWindowTopLine(null, itemRevIndex, null, null);
    			AIFComponentContext[] contexts = parentBomLine.getChildren();
    			if(contexts != null && contexts.length > 0){
    				for(AIFComponentContext context : contexts){
    					InterfaceAIFComponent interfaceAIFComIndex = context.getComponent();
    					if(interfaceAIFComIndex instanceof TCComponentBOMLine){
    						TCComponentBOMLine bomLineIndex = (TCComponentBOMLine) interfaceAIFComIndex;
    						if(itemRev == bomLineIndex.getItemRevision()){
    							bomLine = bomLineIndex;
    						}
    					}
    				}
    			}
    		}
    		TCComponentBOMLine[] bomLineSubstitutes = bomLine.listSubstitutes();
    		if(bomLineSubstitutes != null && bomLineSubstitutes.length > 0){
    			for(TCComponentBOMLine bomLineIndex : bomLineSubstitutes){
    				try
    		        {
    		          RelatedSubstituteComp[] arrayOfRelatedSubstituteComp1 = bomLineIndex.getRelatedSubstitutes();
    		          if ((arrayOfRelatedSubstituteComp1 != null) && (arrayOfRelatedSubstituteComp1.length > 0))
    		          {
    		            StringBuilder localStringBuilder = new StringBuilder();
    		            RelatedSubstituteComp[] arrayOfRelatedSubstituteComp2;
    		            int m = (arrayOfRelatedSubstituteComp2 = arrayOfRelatedSubstituteComp1).length;
    		            for (int k = 0; k < m; k++)
    		            {
    		              RelatedSubstituteComp localRelatedSubstituteComp = arrayOfRelatedSubstituteComp2[k];
    		              localStringBuilder.append(localRelatedSubstituteComp.toDisplayString());
    		              localStringBuilder.append("
    ");
    		            }
    		            if (true)
    		            {
    		              removeRelatedSubstitute(bomLineIndex);
    		              bomLineIndex.cut();
    		            }
    		          }
    		          else
    		          {
    		        	  bomLineIndex.cut();
    		          }
    		        }
    		        catch (TCException e)
    		        {
    		          e.printStackTrace();
    		          return;
    		        }
    			}
    		}
    	}
    

      

  • 相关阅读:
    学习asp.net完整步骤
    UltraEdit中Matlab语法高亮显示的操作方法
    C#基础完成和深入
    75道程序员面试逻辑思维题
    模拟退火算法解决函数优化问题
    模拟退火算法解决TSP问题
    C#入门
    简单感知器模型解决简单真值表问题
    jQuery 1.3.2 :visible选择器问题
    NUnit2.0详细使用方法
  • 原文地址:https://www.cnblogs.com/wwssgg/p/15213930.html
Copyright © 2011-2022 走看看