ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
BPBruce Perry02/09/2015

I tried a number of thing. Most of them commented out, ended up using the name to activate the configuration.

I am using SW2011.

There should be a way to get to the parent configuration from the derived configuration even if it means, just moving back up the ladder?

'Sets the active configuration to the named title

'MyConfigurationName = swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name

'swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name = swApp.ActiveDoc.GetTitle() & " - Open"

Debug.Print swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name

'Rename Active Configuration

swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name = swApp.ActiveDoc.GetTitle() & " - Open"   ', "", "", 1, swConf.Name, swApp.ActiveDoc.GetTitle())

                                                                '(swApp.ActiveDoc.GetTitle() + " - Closed", "", "", 1, swConf.Name, swApp.ActiveDoc.GetTitle())

'Get Active Configuration

Set swConfig = swModel.GetConfigurationByName(swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name)

MyConfigurationName = swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name

Debug.Print "My Config :" & MyConfigurationName

'Set swDerivConf = swConfMgr.AddConfiguration(swConf.Name + " Config Name Addition", "Configuration Comment", "User Specified Name BOM", 1, swConf.Name[Parent Configuration], "Configuration Description")

'Add a Derived Configuration

Set swDerivConf = swConfMgr.AddConfiguration(swApp.ActiveDoc.GetTitle() + " - Closed", "", "", 1, swConfig.Name, swApp.ActiveDoc.GetTitle())

'

swModel.ShowConfiguration2 (MyConfigurationName)

Debug.Print swApp.ActiveDoc.ConfigurationManager.ActiveConfiguration.Name

End Sub