BOM Table blank when using swBomType_TopLevelOnly

Hi,

I posted on another thread however I thought it would be a good idea to post the specific problem/code here.

I have the following code within a VB.NET (2010) AddIn.

 

        Dim mySWDoc As ModelDoc2 = iSwApp.ActiveDoc

        Const sBOMTemplate As String = "c:\testboms\bom-standard.sldbomtbt"

        Dim myBOMTable As New BomTableAnnotation

        myBOMTable = mySWDoc.Extension.InsertBomTable(sBOMTemplate, 0, 0, swBomType_e.swBomType_TopLevelOnly, "-001 (Export)")

        Dim myTable As TableAnnotation = myBOMTable

I subsequently dump myTable out to Excel.

When I use the type swBomType_TopLevelOnly, I only get a header row. Either of the other two types produces results as expected (multiple rows representing components).

As an alternative I can use recursion to get a BOM, however that does not return the children in the order they are in the FMT, which is the current request from my users.

Thanks for any help.

P.s. using SW2009 SP3.

SolidworksApi macros