Below is the script I'm trying to run but it will not overwrite the input layer. I'm not sure what I'm doing wrong.....
# Import arcpy module
import arcpy, datetime, os
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"G:\****************************\Files"
arcpy.MakeFeatureLayer_management("ApprovedApproachesCy2.shp", "ApprovedApproachesCy2")
arcpy.SelectLayerByAttribute_management("ApprovedApproachesCy2", "NEW_SELECTION", "Culvert_Re = 'yes' AND Date_Appro = CURRENT_DATE")
arcpy.CopyFeatures_management ("ApprovedApproachesCy2", "ApprovedApproachesCy2")
print "Complete"
Solved! Go to Solution.
I have seen that before. I suspect that the object you are trying to overwrite hasn't been 'released' during the process.
You may have to add a 'Delete' (not tested)
arcpy.MakeFeatureLayer_management("ApprovedApproachesCy2.shp", "temp")
arcpy.SelectLayerByAttribute_management("temp", "NEW_SELECTION", "Culvert_Re = 'yes' AND Date_Appro = CURRENT_DATE")
arcpy.CopyFeatures_management ("temp", "ApprovedApproachesCy2")
arcpy.Delete_management ("temp")
print "Complete"
anagement
I have seen that before. I suspect that the object you are trying to overwrite hasn't been 'released' during the process.
You may have to add a 'Delete' (not tested)
arcpy.MakeFeatureLayer_management("ApprovedApproachesCy2.shp", "temp")
arcpy.SelectLayerByAttribute_management("temp", "NEW_SELECTION", "Culvert_Re = 'yes' AND Date_Appro = CURRENT_DATE")
arcpy.CopyFeatures_management ("temp", "ApprovedApproachesCy2")
arcpy.Delete_management ("temp")
print "Complete"
anagement