I am using for loops to loop through a list of hexagon feature classes, selecting those hexagons in each feature class that overlap hexagons in each of the other feature classes and then calculating conflict scores for each of the overlapping records. The conflict scores are derived from an Excel table containing names of the two feature classes being compared and the relevant conflict score. The code seems to work fine, with no errors, except that it populates all records with the relevant conflict score, not just those records that overlap (the selected records). The code below shows the last few lines of the code. fc1 and fc2 represent the two layers being compared; fieldnames 1, 2 and 3 are defined earlier in the code and are derived by modifying feature class and field names.
with arcpy.da.SearchCursor(conflictScores, ["Activity1", "Activity2", "ConflictScore"]) as cursor:
for row in cursor:
print("START ROWS)")
if row[0] == fieldname1 and row[1] == fieldname2:
score = row[2]
print(score)
arcpy.management.SelectLayerByLocation(fc1, "HAVE_THEIR_CENTER_IN", fc2, "", "NEW_SELECTION")
arcpy.management.CalculateField(fc1, fieldname3, score)
print(fc1, fieldname3, score)