Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: KWarrenCA

Hi @KWarrenCA.  It seems clear that the code you posted is just part of a larger block of code, because there  does not appear to be a Sub Main or  a declaration line for the oListComp variable.  Have you considered using the ComponentOccurrences.AllReferencedComponents(Object) method?  You can supply a DocumentDescriptor, ComponentOccurrence, or Document as input, and it will return a ComponentOccurrencesEnumerator containing every component that references the input.  You may be able to use that from the top/main assembly's AssemblyComponentDefinition.Occurrences property, and it will reach every level of the assembly.  Then you could iterate the components in the returned collection to gather the needed data.  Just one thought that crossed my mind when I read your post.  

Wesley Crihfield

EESignature

(Not an Autodesk Employee)