Solid Edge Framework Type Library
GetBomStructure Method
Specify the ItemID of the Item.
Specify the RevID of the Item.
Revision rule of the file.
Boolean for generating BOM. If FALSE then function returns first level BOM structure and if TRUE then function returns deep level BOM structure.
Number of components in the BOM structure.
2D Array of ItemID and RevID of the components.
2D Array of fileSpec and number of occurrences of the components
Description
Returns the BOM Structure for the input ItemRev from the server
Syntax
Visual Basic
Public Sub GetBomStructure( _
   ByVal bstrItemId As String, _
   ByVal bstrItemRevId As String, _
   ByVal bstrRevisionRule As String, _
   ByVal bDeepList As Boolean, _
   ByRef NoOfComponents As Long, _
   ByRef ListOfItemRevIds As Variant, _
   ByRef ListOfFileSpecs As Variant _
) 
Parameters
bstrItemId
Specify the ItemID of the Item.
bstrItemRevId
Specify the RevID of the Item.
bstrRevisionRule
Revision rule of the file.
bDeepList
Boolean for generating BOM. If FALSE then function returns first level BOM structure and if TRUE then function returns deep level BOM structure.
NoOfComponents
Number of components in the BOM structure.
ListOfItemRevIds
2D Array of ItemID and RevID of the components.
ListOfFileSpecs
2D Array of fileSpec and number of occurrences of the components
Remarks
This function will be used to get the BOM structure of the particular assembly on the server. The function returns the total number of components, array of ItemID and RevID of the components and array of fileSpec and number of occurrences of the components present on the server. This function also provides the functionality of getting one level or deep level BOM structure.
Example
Option Explicit

Sub Example()
    Dim objApplication As SolidEdgeFramework.Application
    Dim objTCE As SolidEdgeFramework.SolidEdgeTCE
    Dim nCount As Long
    Dim ubnd As Integer
    Dim ifileSpec As Integer
    Dim ItemRevIds As Variant
    Dim fileSpecs As Variant
    Dim itemID As String
    Dim revID As String
    Dim revRule As String
    Dim bDeepList As Boolean

    Set objApplication = GetObject(, "SolidEdge.Application")
    Set objTCE = objApplication.SolidEdgeTCE

    itemID = "1"
    revID = "A"
    revRule = "Latest Working"
    nCount = 0
    bDeepList = False
    Call objTCE.GetBomStructure(itemID, revID, revRule, bDeepList, nCount, ItemRevIds, fileSpecs)

    'nCount = Number of components in the BOM structure.
    If nCount > 0 Then
        ubnd = UBound(fileSpecs)
        For ifileSpec = 0 To ubnd
            'fileSpecs(ifileSpec, 0): FileName of the component
            'fileSpecs(ifileSpec, 1): number of occurrences of the component
        Next
        
        ubnd = UBound(ItemRevIds)
        For ifileSpec = 0 To ubnd
            'ItemRevIds(ifileSpec, 0) = ItemID of the component
            'ItemRevIds(ifileSpec, 1) = RevID of the component
        Next
    End If

    If Not objApplication Is Nothing Then
        Call objApplication.Quit
    End If
    
    Set objTCE = Nothing
    Set objApplication = Nothing
End Sub
See Also

SolidEdgeTCE Object  | SolidEdgeTCE Members  | Solid Edge ST - What's New  | Solid Edge V20 SP6 - What's New