其他功能 > 製造流程管理 > 將 eBOM 轉換為 mBOM > 建立 mBOM > 「產生下游結構」動作概觀 > 使用案例:產生下游結構 > 使用案例 13:透過根據範圍屬性略過零件來產生下游結構
使用案例 13:透過根據範圍屬性略過零件來產生下游結構
您可以透過定義範圍來產生下游結構。在某些情況下,您可能不想傳輸屬性值在特定範圍內的零件。則可以使用略過屬性來略過屬性值在特定範圍內的此類零件。
假設 BOM 轉換器中存在以下結構:
Upstream Parent Part (Design)Downstream Parent Part (Manufacturing) 之間存在對等連結。
結構中所有零件的零件類型均為 wt.part.WTPart
偏好設定「用於定義範圍的分隔符號」的值設定為 >。此為預設值。
屬性 GDS_Match 建立在 WTPart 中。使用此屬性可定義範圍。
屬性 skip_range 建立在 WTPart 中。使用此屬性可略過零件。
Part D1 (Manufacturing) 的屬性 source 的值設定為 buy
欲透過根據範圍屬性略過零件產生下游結構,您可以使用規則檔案或內容檔案來指定轉換與重新建構規則。
使用規則檔案
{
"transformRules": [
{
"sourceType": "wt.part.WTPart",
"newAttributeMappings": [
[
"source.usage.GDS_Match:1>9",
"target.part.source:buy"
]
"targetType": "wt.part.WTPart",
"transformOption": "newBranch"
"skipAttributes":[
"skip_range=a20>a90"
]
}
]
}
使用內容檔案
1. 存取位於 Windchill/codebase/com/ptc/core/foundation/associativity 中的 associativity.properties.xconf 檔案。
2. 新增下列重新建構規則:
<Property name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" multivalued="," default=""/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="transformOption=newBranch"/>
<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=GDS_Match:1>9:source:buy"/>
<AddToProperty name="com.ptc.windchill.associativity.reconciliation.addusage.wt.part.WTPart" value="skipAttribute.skip_range=a20>a90"/>
* 
GDS_Match1>9 描述範圍。偏好設定「用於定義範圍的分隔符號」的值設定為 >1>9 表示範圍從 19。在此情況下,系統會考慮下列值進行比較:123456789
skip_rangea20>a90 描述範圍。偏好設定「用於定義範圍的分隔符號」的值設定為 >a20>a90 表示範圍從 a20a90
執行「產生下游結構」動作之後,下列結構會顯示在「BOM 轉換器」中:
系統會橫移所選零件下方的結構。組態可確保下列情況:
如果上游零件的屬性 GDS_Match 的值為從 19,則會將上游零件新增為目標相符下游零件下的新分支。
如果 Windchill 系統偵測到上游中的零件,且其屬性 skip_range 值設定為從 a20a90,則此零件會被略過,且不會在下游新增。但是,會遍歷偵測到的零件之下的結構。
根據指定的條件,Part C1 (Manufacturing)Part C2 (Manufacturing)Part C6 (Manufacturing)Part C7 (Manufacturing) 會新增為 Part D1 (Manufacturing) 下的新零件。
Subassembly C4Subassembly C5 會被跳過且不會傳輸至下游檢視,因為 skip_range 屬性的值介於指定範圍 (即 a20>a90) 之間。
這是否有幫助?