Convert VBA to VB.NET BOM Table Feature

Hello Guys!

Can someone help me to convert the following code to VB.net. Seems like it doesn`t understand what to do with items in bold:

Original code was taken from : 2012 SOLIDWORKS API Help - Insert BOM Table Example (VBA)

        Set swBomFeat = swBomTable.BomFeature

        Names = swBomFeat.GetConfigurations(False, Visible)

        Visible(0) = True

        boolStatus = swBomFeat.SetConfigurations(True, Visible, Names)

Thank you.

SolidworksApi macros
Answers 2
FV
FV 2016-05-06 Best Answer

Hi Sanya,

Please try declaring Visible as a regular object. The variant type is specific to VBA implementation, the equivalent in VB.net is simply object.

<p>Dim Visible as Object</p><p>swBomFeat = swBomTable.BomFeature</p><p>Names = swBomFeat.GetConfigurations(False, Visible)</p><p>Visible(0) = True</p><p>boolStatus = swBomFeat.SetConfigurations(True, Visible, Names)</p>

Hope this helps,

Filipe

SF
SF 2016-05-07

Thank you Filipe!