0

I am new to Teamcenter rich client programming. I am trying to figure out how can I indicate/extract the contents of a BOMView item in Teamcenter.

I am using Java, and until now I could, for example, use AIFComponentContext and TCComponent to get a Parent/child tree of any other object in Teamcenter but not a BOMView...

Does anyone to know how I can get the children items of BOMView? (Currently this can be seen only in the "Teamcenter-Structure manager" view in the rich client).

Saeed_ghg
  • 1
  • 2

1 Answers1

0

I think you want to use 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());
    }
}

Once you have that method you declaration will look something like this.

OpenBomWindow(
(CreateBOMWindowsResponse bomResponse) =>
{
    Mstrong.BOMLine bomLine = bomResponse.Output[0].BomLine;
},
parentItemRev);
herbie13
  • 1
  • 3