AnsweredAssumed Answered

GetTableAnnotations Method (IBomFeature) returns empty array

Question asked by Xavier Rodríguez Nieto on Apr 12, 2017
Latest reply on Apr 13, 2017 by Peter Brinkhuis

Dear all,

I have a problem with the 'GetTableAnnotations' method of the 'IBomFeature' object, I'm quite sure that it's returning an empty array, event when the BOM table in the drawing is not empty.

The process of getting the 'IBomFeature' works OK, I have checked it with the 'Name', 'TableType' and other properties and the results are as expected, so I assume that the pointer to the BOM works properly.

 

The code it's like this:

______________________

 

Option Explicit

Dim swApp As ISldWorks

Dim swModel As IModelDoc2

Dim swFeat As IFeature

Dim swBom As IBomFeature

Dim vTableArr As Variant

Sub main()

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

    Set swFeat = swModel.FirstFeature

    Do While Not swFeat Is Nothing

        If swFeat.GetTypeName2 = "BomFeat" Then

            Set swBom = swFeat.GetSpecificFeature2

            vTableArr = swBom.GetTableAnnotations

            MsgBox (swBom.Name & " - " & swBom.GetTableAnnotationCount & " - " & UBound(vTableArr))

        End If

        Set swFeat = swFeat.GetNextFeature

    Loop

End Sub

_________________________

 

In my drawing I have only one BOM inserted named "Lista de materiales1", and what I get prompted is:

I've tried with different drawings, different types of BOM (top level only, parts only, indented no numbering, indented flat numbering...), I don't know what's wrong.

 

Any idea?

Outcomes