I have a cursor cycling through several polygon features. Would like to pass the current cursor entry to the Select by Location tool, to select a series of lines contained by the polygons. I am getting an error stating the Select by Location tool is not working.
Is my syntax correct? In the for loop, I defined for "Cup_row in C_update"; do I just pass "Cup_row" as the input to the "SelectLayerByLocation_management" tool
The "A2" exception is displaying "Object: Error in executing tool"
for Cup_row in C_update: C_count+=1 Cup_totalest = Cup_row Cup_totalmoe = Cup_row Cup_pairid = Cup_row Cup_subpairs = Cup_row Cup_OX = Cup_row Cup_OY = Cup_row Cup_DX = Cup_row Cup_DY = Cup_row #initial values Cup_totalest = 0.0 Cup_totalmoe = 0.0 Cup_pairid = "" C_pairlist =  if(p_er):print "A1" #---Select Subpairs containted by corridor---## try: arcpy.SelectLayerByLocation_management(Cup_row, "COMPLETELY_CONTAINS", P_paths, "", "NEW_SELECTION") except Exception as A2: arcpy.AddError(A2) print "A2 "+ str(A2)