I'm unzipping a file, adding the shapefile contained within it to my map, and then trying to select by intersection with another layer.
The script runs fine but nothing gets selected.
I've also tried for the final line:
But no luck.
Any help? Thanks!
The script runs fine but nothing gets selected.
Code:
import arcpy, zipfile, os.path
from arcpy import env
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
env.workspace = 'C:\Job\Frontline\Workspace'
TheZIP = arcpy.GetParameter(0)
TheP6 = arcpy.GetParameter(1)
zfile = zipfile.ZipFile(str(TheZIP))
zfile.extractall(r'C:\Job\Frontline\Workspace')
fc = arcpy.ListFeatureClasses ()
for f in fc:
addLayer = arcpy.mapping.Layer(f)
arcpy.mapping.AddLayer(df, addLayer)
arcpy.MakeFeatureLayer_management(addLayer, "parcel_lyrr")
arcpy.SelectLayerByLocation_management (addLayer, "INTERSECT", TheP6)
Code:
arcpy.SelectLayerByLocation_management ("parcel_lyrr", "INTERSECT", TheP6)
Any help? Thanks!