Try this: #CODE|Traverse Feature Tree in Part
it counts Revolutions and Extrusions in feature tree for a part.
If needed to get the same information from a selected component in assembly, then you can slightly modify the macro above using this example: #CODE|Traverse All Features in Component
Unfortunately, in some versions of Solidworks feature have different names of type even when they are build using the same "Extruded Boss/Base" command. So far I found: "Extrusion","Boss" or "ICE"
Also, it seems that in some versions "Extruded Cut" can have the same type name as "Extruded Boss/Base"
Hope this helps
The result of the macro: