If this what you were trying to achieve, hope the comments and cryptic variable names explain the process adequately.
You should be able to take this forward and group the subdivided surfaces by the number of vertices.
Revit: Massing-Test_20160514.rvt
File: DivideSurfaces-20160514.dyn