The active configuration is whichever config is currently being displayed if the part is open or whichever was displayed when it was saved if it is not open. Unless you specifically tell the macro which configuration to display, you have no way of predicting what configuration this will be.
The iComponent2::ReferencedConfiguration is whichever configuration is specified to be used in the assembly for that particular component.
I'm not sure what your macro is trying to accomplish, but my guess is that "ReferencedConfiguration" will give you better results.
I'm basically traversing an assembly, and summing Sale Prices. If it's a sub assembly, I use a Price 1custom property, and if it's a top level part in the parent assembly, I use a Price 2 property.
As you said, Referenced Configuration is giving me the correct results. I'm still learngeting the API, so my first instinct was to use GetActiveConfiguration, which was behaving seemingly unpredictably.
Thank you for your reply.
Also, side question, any idea on how to snag custom properties from "parts only" in a sub assembly? Right now, i'm dissolving all the sub-subassemblies to grab the custom props, but I am certain there's a better way.
Use IComponent2::GetChildren to get an array of components in the sub-assembly. Loop through the array of child components and get the properties.