How to use GetBomTable?

use key  code: Set swBomTable = swView.InsertBomTable2, Success, see follow Code.

but use key code  Set swBomTable = swView.GetBomTable()---- don't success.

  

Target:

How to use GetBomTable?

debug.print Result

项目号,零件号,数量
1,件号1-5法兰-FM,1
2,件号1-2短节,1
3,件号1-1封头,1
4,件号1-3法兰,2
5,件号1-4接管,2
6,件号1-6隔板,1

see Fig

'Insert BOM Table and Get Data Example (VB)
'This example shows how to insert a BOM table and the extract the data from it.

'--------------------------------------
'
' Preconditions:
' (1) Drawing is open.
' (2) View in open drawing is selected.
'
' Postconditions: BOM table is inserted at the point where the view was selected.
'
'--------------------------------------
Option Explicit
Public Enum swBOMConfigurationAnchorType_e
swBOMConfigurationAnchor_TopLeft = 1
swBOMConfigurationAnchor_TopRight = 2
swBOMConfigurationAnchor_BottomLeft = 3
swBOMConfigurationAnchor_BottomRight = 4
End Enum
Public Enum swBomType_e
swBomType_PartsOnly = 1
swBomType_TopLevelOnly = 2
swBomType_Indented = 3
End Enum
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swView As SldWorks.View
Dim swBomTable As SldWorks.BomTableAnnotation
Dim swTable As SldWorks.TableAnnotation
Dim swAnn As SldWorks.Annotation
Dim vPickPt As Variant
Dim nNumCol As Long
Dim nNumRow As Long
Dim sRowStr As String
Dim i As Long
Dim j As Long
Dim bRet As Boolean

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swView = swSelMgr.GetSelectedObject5(1)

vPickPt = swSelMgr.GetSelectionPoint(1)

Set swBomTable = swView.InsertBomTable2( _
False, _
vPickPt(0), vPickPt(1), _
swBOMConfigurationAnchor_TopLeft, _
swBomType_Indented, _
"", _
""): Debug.Assert Not swBomTable Is Nothing
Set swTable = swBomTable
Set swAnn = swTable.GetAnnotation

nNumCol = swTable.ColumnCount
nNumRow = swTable.RowCount

' List BOM contents
For i = 0 To nNumRow - 1
sRowStr = ""
For j = 0 To nNumCol - 1
sRowStr = sRowStr & swTable.Text(i, j) & ","
Next j
Debug.Print Left(sRowStr, Len(sRowStr) - 1)
Next i
End Sub
'--------------------------------------

Thanks

SolidworksApi macros