AnsweredAssumed Answered

How to select bomtable in Feature.

Question asked by Yong Ning on Nov 28, 2013
Latest reply on Jul 25, 2015 by Yong Ning

b1.jpg

Select bomtable code  result is

*****************

ITEM NO.

PART NUMBER

QTY.

******************

 

Sub main()

    Dim swApp                   As SldWorks.SldWorks

    Dim SwModel                 As SldWorks.ModelDoc2

    Dim swSelMgr                As SldWorks.SelectionMgr

    Dim swTable                 As SldWorks.TableAnnotation

    Dim swBomTable              As SldWorks.BomTableAnnotation

    Dim i                       As Long

    ''

    Set swApp = Application.SldWorks

    Set SwModel = swApp.ActiveDoc

    Set swSelMgr = SwModel.SelectionManager

    Set swTable = swSelMgr.GetSelectedObject5(1)  

    ''

    For i = 0 To swTable.ColumnCount

        Debug.Print swTable.GetColumnTitle(i)

    Next i

End Sub

******************

 

Help. know bomtable name. How to select bomtable?

 

b2.jpg

 

 

for example. Know  bomtable name of Bill of Materials1

  

'boolstatus = SwModel.Extension.SelectByID2("Bill of Materials1", "BOMFEATURE", 0, 0, 0, False, 0, Nothing, 0)

 

 

    Dim swBomTable              As SldWorks.BomTableAnnotation

    Set swTable = ????????????

 

Thanks

Attachments

Outcomes