How to find the number of polygons enclosed by preview lines and walls?

@James_BIM ,
try to look here:

and here: