Get Table Anchor Example (VBA)
This example shows how to get the selected bill of materials' table
anchor.
'---------------------------------------------------
'
' Preconditions: Drawing document is open that has a
' bill
of materials.
'
' Postconditions: None
'
'---------------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc
Dim swFeat As SldWorks.Feature
Dim swSelMgr As SldWorks.SelectionMgr
Dim swTableAnchor As SldWorks.TableAnchor
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
' Select a bill of materials table anchor
' in the FeatureManager design tree
Set swFeat = swSelMgr.GetSelectedObject6(1,
0)
Set swTableAnchor = swFeat.GetSpecificFeature2
Debug.Print "Type of table anchor = " &
swTableAnchor.Type
End Sub