how to count assembly and subassemblies component with doc manager API

Hi guys,

I have to count all the components in one assembly (and subassemblies) and I would want to do it with the document manager API. Can anyone help me?

Thank you

Regards

SolidworksApi macros