Windchill Navigate API > 可用 API > 实用程序 API > GetSelectedItemsFromSelectedParts
GetSelectedItemsFromSelectedParts
说明
将在 ThingView 小组件中所做的部件选择转换为项列表组件中的部件选择。此服务支持交叉突出显示用例。
事物
PTC-PLM.Windchill.BillOfProcess.Utility
输入
用于标识要从后端系统中获取的数据。
参数
类型
说明
必需
selectedParts
INFOTABLE
SelectedParts 特性从 ThingView 返回的选定部件。
structurePropertyValues
INFOTABLE
GetFilteredStructurePropertyValues 返回的经过筛选的结构特性值。
version
STRING
API 版本。
示例 
下面是一个 JavaScript 服务,将通过演示输入启动 GetSelectedItemsFromSelectedParts 服务。
这两个信息表将作为 JSON 结构进行填充。
const selectedParts ={
dataShape: {
fieldDefinitions: {
idPath: {
name: "idPath",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_0",
aspects: {}
},
propGroup: {
name: "propGroup",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_1",
aspects: {}
},
propName: {
name: "propName",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_2",
aspects: {}
},
propValue: {
name: "propValue",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_3",
aspects: {}
}
}
},
rows: [
{
"idPath": "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161@1574/0:8671bacd-1a38-4319-9550-b3ef1410c2f0",
"_isSelected": false
}
],
name: "",
description: ""
};
const structurePropertyValues = {
dataShape: {
fieldDefinitions: {
idPathRoot: {
name: "idPathRoot",
description: "idPathRoot",
baseType: "STRING",
ordinal: 0,
alias: "_0",
aspects: {}
},
idPath: {
name: "idPath",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_1",
aspects: {}
},
propGroup: {
name: "propGroup",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_2",
aspects: {}
},
propName: {
name: "propName",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_3",
aspects: {}
},
propValue: {
name: "propValue",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_4",
aspects: {}
}
}
},
rows: [
{
idPathRoot: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToConsumableLink:3341",
idPath: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToConsumableLink:3341",
propGroup: "WindchillPart",
propName: "part_name",
propValue: "Tool-Table"
},
{
idPathRoot: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161",
idPath: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161@1574",
propGroup: "WindchillMPMLink",
propName: "operationToPartUniqueId",
propValue: "MPMOperationToPartLink:11161"
}
]
};
// result: INFOTABLE dataShape: ""
result = Things["PTC-PLM.Windchill.BillOfProcess.Utility"].GetSelectedItemsFromSelectedParts({
selectedParts: selectedParts,
structurePropertyValues: structurePropertyValues /* INFOTABLE */,
version: "1" /* STRING */
});
输出
以下输出是执行上述演示 JavaScript 代码的结果:
示例 
{
"timeStamp": "2025-02-19 10:09:44.593",
"data": [
{
"itemListsData": [
{
"items": [
{
"CrossSelectionId": {
"value": "MPMOperationToPartLink:11161"
}
}
],
"objectType": "PTC.ProdMgmt.Part.Custom.Adapter"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
],
"statusMessage": "OK",
"status": "200"
}
使用
针对 ThingView 中的 SelectionChanged 事件启动此服务。将 GetFilteredStructurePropertyValues 服务的输出绑定到 structurePropertyValues 输入。
将此服务的结果绑定到 ItemList 特性 SelectedItems
这对您有帮助吗?