使用案例 16:根據出現位置屬性產生下游結構
請考慮這樣一種情境:即 BOM 轉換器中存在以下結構:
Top_Assembly (Design)Top_MBOMAssembly (Manufacturing) 之間存在對等連結。
針對出現位置屬性 OccIBAPart1Part2Part3 的值分別為 occv1occv2occv3
針對屬性 PartAttributeMBOM_Assembly1MBOM_Assembly2MBOM_Assembly3 的值分別為 Value1Value2Value3
欲根據出現位置屬性產生下游結構,您可以使用規則檔案或內容檔案來指定轉換與重新建構規則。
* 
此功能正在強化中。現在,請使用此組態將上游零件的所有出現位置轉換為下游結構。
使用規則檔案
在文字檔案中,新增 JSON 格式的下列規則:
{
"transformRules": [
{
"sourceType": "wt.part.WTPart",
"sourceAttributes": ["genericType=standard"],
"newAttributeMappings": [
[
"source.occurrence.OccIBA:occv1",
"target.part.PartAttribute:Value1"
],
[
"source.occurrence.OccIBA:occv2",
"target.part.PartAttribute:Value2"
],
[
"source.occurrence.OccIBA:occv3",
"target.part.PartAttribute:Value3"
]
],
"transformOption": "newBranch",
"targetType": "wt.part.WTPart"
}
]
}
使用內容檔案
1. 存取位於 Windchill/codebase/com/ptc/core/foundation/associativity 中的 associativity.properties.xconf 檔案。
2. 新增下列重新建構規則:
<Property name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" multivalued="," default=""/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="attribute.genericType=standard"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule1.entry1=source.occurrence.OccIBA:occv1,newAttributeMapping.rule1.entry2=target.part.PartAttribute:Value1"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule2.entry1=source.occurrence.OccIBA:occv2,newAttributeMapping.rule2.entry2=target.part.PartAttribute:Value2"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="newAttributeMapping.rule3.entry1=source.occurrence.OccIBA:occv3,newAttributeMapping.rule3.entry2=target.part.PartAttribute:Value3"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="transformOption=newBranch"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart.rule1" value="targetType=wt.part.WTPart"/>
執行「產生下游結構」動作之後,下列結構會顯示在「BOM 轉換器」中:
根據在規則檔案或內容檔案中指定的條件,會以下列方式產生下游結構:
OccIBA 值為 occv1Part1 的 2 個出現位置已新增到 PartAttribute 值為 Value1MBOM_Assembly1 (Manufacturing) 之下。
OccIBA 值為 occv2Part2 的 2 個出現位置已新增到 PartAttribute 值為 Value2MBOM_Assembly2 (Manufacturing) 之下。
OccIBA 值為 occv3Part3 的 2 個出現位置已新增到 PartAttribute 值為 Value3MBOM_Assembly3 (Manufacturing) 之下。
這是否有幫助?