Unless I misremember, drilling down is not required. GetComponents(False) returns an array of all components in the assembly, not just top level. If all you care about is unique part/config in the top level, analyzing the returned array is probably simplest.

Thanks Ivana (and all others) for the help. That code worked well with a few tweaks, primarily "If UBound(swComponent.GetChildren) = -1" as Amen suggested, otherwise the assembly color overwrites the underlying part colors. I've added a bit more to make the color selection slightly cleaner using the golden ratio method described here: http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/

The other option would be to count all the parts and pick that many colors equally spaced, but this yielded good enough results. One limiting factor right now is the order the parts get colored means many of my parts end up similar colors. Is there a good way to randomly re-order the list returned by GetComponents? That would let me run the macro a few times until the colors were a bit better distributed.

Actually managed to answer my own question. Its a bit of a hack, but I generated an array that counted from zero to the number of components, did a random arrangement of that array (courtesy of Shuffle Array ), and then used that array as the indices to loop through all the components. It didn't have as big of an impact as I was hoping, but it does help. I can cycle through a few times until I avoid clusters of similar colors.

I also added a quick hard-coded variable for my fastener path to avoid running this on my fasteners. Mostly, this is to reduce the number of components with the aim of having a slightly cleaner color spread.

Everything generally works fine with this macro and I can assign colors without a problem. However, if I add new parts to an old assembly and then re-run the macro, it only assigns appearances to new parts, not old. Does anyone have any ideas about why this would happen? It seems to still be iterating through and generating colors for all parts, but they're not sticking.