Private Sub del20150115()
Dim SwApp As SldWorks.SldWorks, swModel As ModelDoc2, SwDraw As DrawingDoc
Set SwApp = Application.SldWorks
Set swModel = SwApp.ActiveDoc
swModel.ClearSelection2 True
Set SwDraw = swModel
Dim SwFeat As Feature, SwBomFeat As BomFeature
Set SwFeat = SwDraw.FeatureByName("Bill Of Materials1")
SwFeat.Select True
Set SwBomFeat = SwFeat.GetSpecificFeature2
'Debug.Print SwBomFeat.GetFeature.Name
Dim SwBomTabAnn As BomTableAnnotation, SwComp As Component2
Set SwBomTabAnn = SwBomFeat.GetTableAnnotations(0)
With SwBomTabAnn
Debug.Print .BomFeature.GetFeature.Name
Arr = .GetAllCustomProperties
Set SwComp = .GetComponents(1)(0)
Debug.Print SwComp.GetModelDoc.GetTitle
Set SwComp = .GetComponents(2)(0)
Debug.Print SwComp.GetModelDoc.GetTitle
Arr = .GetAllCustomProperties
arr1 = .GetColumnCustomProperty(1)
arr2 = .GetColumnCustomProperty(0)
For kk = 0 To 10
Debug.Print kk, .GetColumnUseTitleAsPartNumber(kk),
Debug.Print .GetColumnCustomProperty(kk)
Next kk
Stop
End With
End Sub
SolidworksApi macros