使用案例 1:根據零件屬性產生下游結構
請考慮這樣一種情境:即 BOM 轉換器中存在以下結構:
Upstream Parent Part (Design)Downstream Parent Part (Manufacturing) 之間存在對等連結。
結構中所有零件的零件類型均為 wt.part.WTPart
欲根據零件屬性產生下游結構,您可以使用規則檔案或內容檔案來指定轉換與重新建構規則。
使用規則檔案
{
"transformRules": [
{
"sourceType": "wt.part.WTPart",
"newAttributeMappings": [
[
"source.usage.Attribute1:String1",
"target.part.Attribute2:String2"
],
[
"source.usage.Attribute3:String3",
"target.part.Attribute4:String4"
]
],
"targetType": "wt.part.WTPart",
"transformOption": "newPart"
}
]
}
使用內容檔案
1. 存取位於 Windchill/codebase/com/ptc/core/foundation/associativity 中的 associativity.properties.xconf 檔案。
2. 將下列重新建構規則新增至 associativity.properties.xconf 檔案:
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="transformOption=newPart"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="targetType=wt.part.WTPart"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="attributeMapping.rule1=Attribute1:String1:Attribute2:String2"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="attributeMapping.rule2=Attribute3:String3:Attribute4:String4"/>
對於涉及對應的內容,為上游與下游指定的對應屬性必須不同。
針對上游中的所選零件啟動 動作後,Windchill 系統會遍歷所選零件下方的結構。此組態可確保:
如果 Windchill 系統偵測到零件屬性 Attribute1 設定為 String1 的零件,則會將偵測到的零件作為新零件新增至下游,使其位於零件屬性 Attribute2 設定為 String2 且零件類型為 wt.part.WTPart 的零件下方。
如果 Windchill 系統偵測到零件屬性 Attribute3 設定為 String3 的零件,則會將偵測到的零件作為新零件新增至下游,使其位於零件屬性 Attribute4 設定為 String4 且零件類型為 wt.part.WTPart 的零件下方。
下列結構會顯示在 BOM 轉換器中:
Part C1 (Manufacturing)Part C2 (Manufacturing) 會分別新增為 Part T1 (Manufacturing)Part T2 (Manufacturing) 下的新零件。
這是否有幫助?