Sorry.. here's the formatted version of the code
if testCount==0:
msg = "You must first add a polygon layer or feature class and select some features to report their acreage."
pythonaddins.MessageBox(msg, 'Area Report', 0)
else:
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.isGroupLayer:
for sublyr in lyr:
tlyr = lyr
else:
tlyr = lyr
dsc = arcpy.Describe(tlyr)
sel_set = dsc.FIDSet
if dsc.shapeType == "Polygon":
if len(sel_set) > 0:
with arcpy.da.SearchCursor(tlyr, ("OID@", "SHAPE@AREA")) as cursor:
for row in cursor:
parea = row[1] + parea
resSQFT = parea
resAC = parea / 43560
resHA = parea / 107639.104