How to get the number of blocks

Is it possible to get the number of blocks in a drawing file?

like

block1 = 5

block2 = 3

SolidworksApi macros