I'm not sure I understand what you are trying to do here. I would just intersect first, then try the SymDiff. But to do what you are trying to do you could try something like this (if you just want to print the areas):
def GetOverlap(infc_a,infc_b):
try:
arcpy.overwriteOutput = True
# Geom object A
Geom_a = arcpy.Geometry()
Geom_a_list = arcpy.CopyFeatures_management(infc_a,Geom_a)
# Geom object B
Geom_b = arcpy.Geometry()
Geom_b_list = arcpy.CopyFeatures_management(infc_b,Geom_b)
# Find Overlaps
for geom in Geom_a_list:
for geomb in Geom_b_list:
if geom.overlaps(geomb):
arcpy.Intersect_analysis([geom, geomb], r'in_memory\Intersection')
arcpy.SymDiff_analysis(geom,geomb,r'in_memory\SymDiff')
Rows = arcpy.SearchCursor(r'in_memory\Intersection')
for Row in Rows:
intersectionArea = Row.Shape.area
Rows2 = arcpy.SearchCursor(r'in_memory\SymDiff')
for r in Rows2:
symArea = r.Shape.area
print "Overlap Area: %s" %str(intersectionArea/43560) # in acres
print "SymDiff Area: %s\n"% str(symArea/43560) # in acres
print 'done'
except:
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + \
str(sys.exc_type) + ": " + str(sys.exc_value) + "\n"
msgs = "ARCPY ERRORS:\n" + arcpy.GetMessages(2) + "\n"
arcpy.AddError(msgs)
arcpy.AddError(pymsg)
print msgs
print pymsg
arcpy.AddMessage(arcpy.GetMessages(1))
print arcpy.GetMessages(1)
if __name__ == '__main__': # This will use the variables in this script
import arcpy, sys, traceback
arcpy.env.overwriteOutput = True
from arcpy import env
env.workspace =r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar"
polygon = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\polygon.shp"
GNIS = r"C:\Users\Luke Kaim\Documents\University of Maine\Fall_2012\Volunteer Geographic Information\simalar\GNIS.shp"
try:
GetOverlap(polygon,GNIS)
except:
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + str(sys.exc_type) + ": " + str(sys.exc_value) + "\n"
msgs = "ARCPY ERRORS:\n" + arcpy.GetMessages(2) + "\n"
arcpy.AddError(msgs)
arcpy.AddError(pymsg)
print msgs
print pymsg
arcpy.AddMessage(arcpy.GetMessages(1))
print arcpy.GetMessages(1)
Note, I displayed area in acres because the areas of my test FCs were in feet. Also, look at the indentation. There were a few indentation errors in yours.