How to get assembly under sub components configuration name

Hi friends !

Assembly A contains assembly B which contains multiple configuration parts. Assembly A also has many different configurations.  When assembly A is added into a general assembly C, how to read the current configuration information in all levels of parts in assembly C correctly? (how to read the C`s BOM correctly in this case )

SolidworksApi macros