1

我是 Teamcenter 富客户端编程的新手。我试图弄清楚如何BOMView在 Teamcenter 中指示/提取项目的内容。

我正在使用 Java,例如,到目前为止,我可以使用AIFComponentContextTCComponent获取 Teamcenter 中任何其他对象的父/子树,但不能BOMView...

有谁知道我如何获得 BOMView 的子项?(目前这只能在富客户端的“Teamcenter-Structure manager”视图中看到)。

4

1 回答 1

1

我想你想使用StructureManagementService.CreateBomWindows

/// <summary>
/// Opens a structure Management BOM Window
/// </summary>
/// <typeparam name="T">BOM window</typeparam>
/// <param name="action">action to do in the BOM window</param>
/// <param name="bomWindowOwner">root node for the BOM window</param>
/// <returns></returns>
public static T OpenBomWindow<T>(Func<CreateBOMWindowsResponse, T> action, ModelObject bomWindowOwner)
{
    CreateBOMWindowsResponse windowResponse = TCProgram.StructureManageServiceCad.CreateBOMWindows(new CreateBOMWindowsInfo[]
    {
        new CreateBOMWindowsInfo()
        {
            ItemRev = bomWindowOwner as Mstrong.ItemRevision,
            Item = bomWindowOwner as Mstrong.Item
        }
    });
    try
    {
        return action.Invoke(windowResponse);
    }
    finally
    {
        TCProgram.StructureManageServiceCad.CloseBOMWindows(windowResponse.Output.Select(x => x.BomWindow).ToArray());
    }
}

一旦你有了这个方法,你的声明将看起来像这样。

OpenBomWindow(
(CreateBOMWindowsResponse bomResponse) =>
{
    Mstrong.BOMLine bomLine = bomResponse.Output[0].BomLine;
},
parentItemRev);
于 2018-01-04T14:41:58.043 回答