AnsweredAssumed Answered

Creating BOM, either BOMtype (top level only) is correct or Configuration, not both.

Question asked by Robert Voogt on Jun 5, 2018
Latest reply on Jun 9, 2018 by Deepak Gupta

Important update.


If I set
Set swBomAnn = swView.InsertBomTable4(True, 0, 0, 4, 2, configuration, bomTemplate, False, 0, False)


to something other than Top-level only, then the configuration is correct!!!


It seems that either the configuration is correct, or the bomtype...


Now I need to find out if it is possible to set the bomtype to Top-level only after creating the BOM.



Hi all,


when I use this macro, see link, solidworks opens an example model and shows the configurations in the model (immediate window).

2015 SOLIDWORKS API Help - Get List of Configurations Example (VBA)


When I apply this to the current open file, I change the following:


I remove "filename = "..." "and change "Set swModel = swApp.OpenDoc6 (etc)" to "Set swModel = swApp.ActiveDoc"


Now, when I run it, I get an error here:

Debug.Print "  Name of active configuration = " & swConfig.Name

error is Object variable or With block variable not set.


This macro does print swModel.GetPathName correctly.


What could be the problem?