Macro that calculates number of undercuts

Does anyone have a macro that can be used to count the number of undercuts on a solid model in respect to one of the primary planes?

SolidworksApi macros