Arcpy Delete Features

06-09-2023 01:37 AM
New Contributor II


I have a python script running in pycharm which selects features and then deletes them. 

The following line gives an error:

The error is as follow: arcgisscripting.ExecuteError: ERROR 160236: The operation is not supported by this implementation.
Failed to execute (DeleteFeatures)

Would appreciate help to solve this error 


0 Kudos
4 Replies
Esri Esteemed Contributor

Hi @DirkThuynsma ,

Can you post a snippet of your code?

Usually, I create a feature layer with the query to select features, and then execute the DeleteFeatures_management on the feature layer.  Ex:


arcpy.MakeFeatureLayer_management(r"C:\temp\data.gdb\parcels", "parcels_lyr", "LandUse = 'RES'")
0 Kudos
New Contributor II

Hi Jake, 

Thanks for the reply. 

Here is the code relevant to the problem. 

Select_2 =, "WITHIN", Select_Attribute, None, "NEW_SELECTION")

delete =
print("Deleted Pools in Layer")

If needed I can post the complete script. 

The script did work perfectly well until recently when I got this error. 

0 Kudos
Esri Esteemed Contributor

What type of layer (i.e. feature class, shapefile) are you performing the selection on.  If it's an Enterprise Geodatabase feature class, is the feature class registered as versioned?

0 Kudos
MVP Notable Contributor

Select_2 is a result object, so meaningless in the context of deleting features. If you look at the help file on the Delete Features tool, what does it take as input for the only parameter it takes? Not a result object but a Feature Layer. You need to understand what the parameter section of the help file is tell you. So to delete the features selected by the SelectlayerByLocation tool you need to feed in the layer which in your code is Seed_Inspection_Pool.  Before you run the delete tool you should always check the number of selected is what you expect.