Select to view content in your preferred language

ModelBuilder - delete a single feature from a feature class

2352
3
06-08-2012 11:57 AM
JamesS1
Regular Contributor
Let's say a feature class has 20 features. How would you delete a single feature (ex: OBJECTID = 7) using tools and ModelBuilder?

I know there is a DeleteFeatures tool, but that deletes ALL of the features.

So basically, I want to define a feature class and an expression and only delete the features that meet the expression...
Tags (2)
0 Kudos
3 Replies
LucasDanzinger
Esri Frequent Contributor
I would make a feature layer, then use the Select Layer by Attribute tool to select out ObjectID = 7. Then use the Delete Features tool. As stated in the help, "If the input is a layer with a selection, only the selected features will be deleted."

Luke
0 Kudos
JamesS1
Regular Contributor
It doesn't make sense. If you make a selection, then you are creating new data of only that selection. When you delete the features from that newly created data, the result is empty. The original remains untouched.

Why doesn't 'Delete Features' have an expression associated with it?
0 Kudos
LucasDanzinger
Esri Frequent Contributor
If you follow the workflow of: Make Feature Layer > Select layer by Attribute > Delete Features, it should work.

All the make feature layer is doing is making a temporary object for model builder to use. It is then performing a select by attribute to the layer (which is your original data) and deleting all selected features.
0 Kudos