API: GetConfigurationNames

I have a code that lets you write properties based on the configuration you are in.

Dim vConfigName as variamt

Dim swConfig as sldworks.configuration

Dim swModel as sldworks.modeldoc2

Dim swModel as sldworks.sldworks

Set swApp = Application.SldWorks

Set swModel = swApp.ActiveDoc

vConfgiName = swModel.GetConfigurationNames

For i = 0 To ubound(vconfigName)

     Set swConfig = swModel.GetConfigurationByName(vConfigName(i))

          Debug.Print swConfig.Name

Next i

That is the simplisting version of my code. My problem it yields more configuration names than I show in the Congiuration tree.

I have one configuration in tree, name, Default

The above code yields

Default

Default-_flexible1 and so on uptp Default-_flexible5

I do not understand why?

Thank you.

SolidworksApi macros
Answers 2
PB
PB 2016-03-07 Best Answer

I don't have a clear answer for you unfortunately, but what kind of document results in this behavior? An assembly, a sheet metal part, simple part? Does it have derived configurations? What happens when you add a configuration, will it add one or six new configs?

JS
JS 2016-03-07

You have  5 instances of an assembly that is flexible in a higher level assembly that is also open.  SolidWorks creates 'secret' configurations in these flexible subassemblies that you aren't supposed to see.

See SPR​ 591968​