Hi,
I'm using the following code to get the active configuration of the childs components:
Configuration config = (Configuration)activeDoc.GetActiveConfiguration();
object[] comps = (object[])((Component2)config.GetRootComponent()).GetChildren();
foreach (Component2 comp in comps) {
// Get cost from component
ModelDoc2 modelDoc = (ModelDoc2)comp.GetModelDoc2();
IConfiguration activeConf = (IConfiguration)modelDoc.GetActiveConfiguration();
string configuration = activeConf.Name;
}
When changing the active configuration of a component via "configure component" in the context menu of the component and running the above code again, there is still the old activeConf.Name returned.
When editing the configured component and showing the file properties and then closing file properties and re-running the above code, activeConf.Name is updated correctly.
What am I missing?
Alex
SolidworksApi macros