Component Count API

I deal with a lot of large scale assemblies and I would liketocreate a macro to do
count of a certain part (by it's name).

Is there a way to do it?SolidworksApi macros