Try this code:import arcpy
arcpy.env.overwriteOutput = True
bigPolygonLayer = r"C:\tmp\Test.gdb\BigPolygons"
smallPolygonLayer = r"C:\tmp\Test.gdb\SmallPolygons"
idField = "YourIDField"
#add new field to target feature class if not exists:
fieldList = arcpy.ListFields(bigPolygonLayer)
fieldNameList = []
for field in fieldList:
fieldNameList.append(field.name)
if not idField in fieldNameList:
arcpy.AddField_management(bigPolygonLayer, idField, "TEXT","","",1023) #you can adjust field length
#loop throug big polygons
bigPolyUC = arcpy.UpdateCursor(bigPolygonLayer)
for bigPolyRow in bigPolyUC:
bigPolyGeom = bigPolyRow.Shape
concatIDLst =[]
#loop through all small polygons, take ID values if small polygon OVERLAPS the big ...
#and add to concat string; (You can change relation to CONTAINS to restrict results)
smallPolySC = arcpy.SearchCursor(smallPolygonLayer)
for smallPolyRow in smallPolySC:
smallPolyGeom = smallPolyRow.Shape
if bigPolyGeom.overlaps(smallPolyGeom):
concatIDLst.append(str(smallPolyRow.getValue(idField)))
concatID = "".join(concatIDLst) #between "" you can add any ID separator: space, comma, etc.
bigPolyRow.setValue(idField, concatID)
bigPolyUC.updateRow(bigPolyRow)
del smallPolySC, smallPolyRow, bigPolyUC, bigPolyRow, bigPolyGeom
For more info how OVERLAPS work check Geometry class.