I currently have a search cursor iterating through a shapefile in ArcGIS 10.1 that selects a feature and runs a viewshed analysis on that feature (and only that feature). What's the easiest way to also export that same feature to a shapefile with the same name in Python?
fieldFID = 'FID'
arcpy.CheckOutExtension("Spatial")
arcpy.MakeFeatureLayer_management (inPoints, "pts")
with arcpy.da.SearchCursor('pts',[fieldFID]) as cursor:
for row in cursor:
fid = str(row[0])
print fid
arcpy.SelectLayerByAttribute_management ("pts", "NEW_SELECTION", '"FID" = {}'.format(fid))
outViewshed = Viewshed(inDEM,"pts",1,"CURVED_EARTH",0.15)
outViewshed.save("C:/temp/output/viewsheds/"+fid)