1

I am trying to delete several feature classes from a file geodatabase using values stored in a user defined list.

The script runs without error but it does not delete the feature classes.

Any suggestions to what I am doing wrong (using ArcMap 10.3)?

import arcpy
arcpy.env.workspace = r"C:\Data\Temp.gdb"
fc_Delete = ["fcOut1a","fc_Out2a","fc_Out3a"]
for fc in fc_Delete:
 if arcpy.Exists(fc):
 arcpy.Delete_management(fc,"")
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 3, 2017 at 13:16
2
  • 1
    Try removing the empty string parameter (ie. "") in the arcpy,delete function Commented Jan 3, 2017 at 13:58
  • Does the results window identify whether to Delete tool was executed or not? If so, the "messages" part will identify which feature class was deleted per iteration of the tool. Commented Jan 3, 2017 at 17:25

1 Answer 1

2

Your code is correct, however I would remove the empty string part of the arcpy delete function.

ie:

arcpy.Delete_management(fc)
Vince
20.5k16 gold badges49 silver badges65 bronze badges
answered Jan 3, 2017 at 13:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.