import Rhino
import rhinoscriptsyntax as rs

def main():
    
    srfs = []
    for g in rs.NormalObjects():
        if rs.IsSurface(g):
            srf = rs.coercesurface(g).UnderlyingSurface()
            if not isinstance(srf, Rhino.Geometry.PlaneSurface):
                srfs.append(srf)
    
    for m in range(-1,4):
        tolerance = rs.UnitAbsoluteTolerance() * 10.0**m
        for srf in srfs[:]:
            if srf.IsPlanar(tolerance):
                print '{} IsPlanar({}): True'.format(srf.GetType().Name, tolerance)
                srfs.remove(srf)

if __name__ == '__main__': main()