How to get cell parametrically?

This cell value is parametrically linked to a part or assembly document. Manually overriding the value will sever this link.

Help me . get cells link parameter to a part or assembly document.

SolidworksApi macros
Answers 1
YN
YN 2013-11-11 Best Answer

Follow code is get bom text. don't read cell link parametrically linked to a part or assembly

Sub main()

    Dim swApp                   As SldWorks.SldWorks

    Dim swModel                 As SldWorks.ModelDoc2

    Dim swSelMgr                As SldWorks.SelectionMgr

    Dim swBomTable              As SldWorks.BomTableAnnotation

    Dim SwBomFeat As BomFeature, SwTableAnnotation As TableAnnotation

    Dim vTableAnnotations

    Dim ss, tmp, Str, ii, jj

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swSelMgr = swModel.SelectionManager

    Set SwBomFeat = swSelMgr.GetSelectedObject2(1)

    ss = SwBomFeat.GetTableAnnotations

    Set SwTableAnnotation = ss(0)

    With SwTableAnnotation

      For ii = 0 To .RowCount

        For jj = 0 To .ColumnCount

           Debug.Print .Text(ii, jj), ",";

        Next jj

        Debug.Print

      Next ii

    End With

End Sub

result is