Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Export features to new shapefile

$
0
0
I am trying to write a small script to export each feature in a featureclass to a new shapefile. When I run it, all I see is red (errors). Any help would be greatly appreciated.

Code:

import arcpy
from arcpy import analysis, env


fc = arcpy.GetParameterAsText(0)
field = arcpy.GetParameterAsText(1)
env.workspace = arcpy.GetParameterAsText(2)


with arcpy.da.SearchCursor(fc, (field,)) as cursor:
    for row in cursor:
        arcpy.MakeFeatureLayer_management(field)


Viewing all articles
Browse latest Browse all 2485

Trending Articles