Delete Features (Data Management) |
|
|
Release 9.3
Last modified March 8, 2012 |
Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Deletes features from the input feature class or layer. If the input is a layer with a selection, only the selected features will be deleted. If the input is a geodatabase feature class or shapefile, all features will be deleted.
Usage tips
Both the geometry and the attributes will be deleted from the affected features.
When working in the map, you may want to start an edit session when using the Delete Features tool. This will give you great improvement in performance and allow you to undo/redo Delete Features operations.
ArcSDE, file, or personal geodatabase feature classes, shapefiles, and layers of these data types are valid input features.
Delete Features allows you to select individual features and delete only those selected. To delete specific features from a feature class, convert the feature class into a layer using Make Feature Layer or by adding it to the ArcMap display. A selection can then be applied by using Select Layer By Attribute or Select Layer By Location or by querying a map layer in ArcMap. Using Delete Features on this layer will delete the selected features from the feature class.
If you want to delete all features from a feature class, run Delete Features on a feature class or a layer without a selection.
The following environments affect this tool: extent and workspace.
Command line syntax
An overview of the Command Line window
DeleteFeatures_management <in_features>
| Parameter | Explanation | Data Type |
| <in_features> |
The feature class, shapefile, or layer containing selected features to be deleted |
Feature Layer |
deletefeatures_management c:/workspace/region.mdb/buildings
Scripting syntax
About getting started with writing geoprocessing scripts
DeleteFeatures_management (in_features)
| Parameter | Explanation | Data Type |
| in_features (Required) |
The feature class, shapefile, or layer containing selected features to be deleted |
Feature Layer |
import arcgisscripting
gp = arcgisscripting.create()
gp.workspace = "c:/city/urbanforests.mdb"
gp.toolbox = "management"
# Create a feature layer and select features to be deleted
gp.makefeaturelayer("street_trees", "street_trees_layer")
query = '[TREE_CONDITION] = "CUT"'
gp.selectlayerbyattribute("street_trees_layer", "NEW_SELECTION", query)
# Deleted selected features
gp.deletefeatures("street_trees_layer")