SelectbyLocation has no result

Discussion created by jiefanyu on Sep 12, 2011
Latest reply on Sep 12, 2011 by jiefanyu
I cannot can the selectbylocation's result. When I just run copyfeature, it gets output. But if I add selectbylocation or select by attribute, nothing  export.

# Create the Geoprocessor
import arcgisscripting, sys, os
gp = arcgisscripting.create()
gp.workspace = "C:\pro"

# Load required toolboxes
gp.AddToolbox("C:\ArcGIS\ArcToolbox\Toolboxes\Data Management Tools.tbx")

    #Select all polygon that overlap the lines
    gp.SelectLayerByLocation_management("county.shp", "INTERSECT", "road.shp","", "NEW_SELECTION")

    # Within the selection (done above) further select only those attributes satisfy some requirement
    #gp.SelectLayerByAttribute_management("county.shp", "[area] > 13862709075", "road.shp")

    # Write the selected features to a new feature class
    gp.CopyFeatures_management("county.shp", "C:\pro\copyfeature.shp")

    # If an error occurred, print the message to the screen
    print gp.GetMessages()

Anyone know why this is happening?