# Using MakeFeatureLayer to select by location in arcpy

I'm trying to assign a state plane zone based on if a point intersects it. I make a feature layer from a feature class. It gets through the loop once and calculates everything correctly, but when it loops again it says that the dataset already exists. Can I put the MakeFeatureLayer command at the top and have it loop through underneath that?

This is the line that it gets stuck on after it calculates the first group of points:
arcpy.MakeFeatureLayer_management(fc,"fcTemp")

``````    for fc in SMON:
print fc + " Started Processing"
arcpy.CalculateField_management(fc, "LATDMS", "decdeg2dms ( !GlobalLati! )", "PYTHON", "def decdeg2dms(dd):\\n    negative = dd < 0\\n    dd = abs(dd)\\n    minutes,seconds =  divmod(dd*3600,60)\\n    degrees,minutes =   divmod(minutes,60)\\n    if negative:\\n        if degrees > 0:\\n            degrees = -degrees\\n        elif minutes > 0:\\n            minutes = -minutes\\n        else:\\n            seconds = -seconds\\n            seconds = round(seconds, 5) #my attempt to define it\\n   \\n    dms = '{0:.0f} {1:.0f} {2:.5f}'.format(degrees, minutes, seconds)\\n    \\n    return (dms)")
arcpy.CalculateField_management(fc, "LONGDMS", "decdeg2dms ( !GlobalLong! )", "PYTHON", "def decdeg2dms(dd):\\n    negative = dd < 0\\n    dd = abs(dd)\\n    minutes,seconds =  divmod(dd*3600,60)\\n    degrees,minutes =   divmod(minutes,60)\\n    if negative:\\n        if degrees > 0:\\n            degrees = -degrees\\n        elif minutes > 0:\\n            minutes = -minutes\\n        else:\\n            seconds = -seconds\\n            seconds = round(seconds, 5) #my attempt to define it\\n   \\n    dms = '{0:.0f} {1:.0f} {2:.5f}'.format(degrees, minutes, seconds)\\n    \\n    return (dms)")

#Assigning State Plane and Unique ID for SMON
#fcTemp = "fcTemp"
arcpy.MakeFeatureLayer_management(fc,"fcTemp")
arcpy.SelectLayerByLocation_management("fcTemp", "INTERSECT", CON, "", "NEW_SELECTION")
urows = arcpy.UpdateCursor("fcTemp")
for urow in urows:
urow.Unique_ID = str(urow.PointID) + str(Con)
urows.updateRow(urow)

arcpy.SelectLayerByLocation_management("fcTemp", "INTERSECT", NDN, "", "NEW_SELECTION")
urows = arcpy.UpdateCursor("fcTemp")
for urow in urows:
urow.StatePlane = 'North Dakota North'
urow.State = 'North Dakota'
urow.Unique_ID = str(urow.PointID) + str(Con)
urows.updateRow(urow)
``````

``````arcpy.env.overwriteOutput = True