Model Builder Select By Location settings

3135
4
06-27-2012 01:49 PM
Mary_AnneVan_Zuyle
New Contributor
In the Select By Location tool, there is a setting to use only selected features in the Source Layer.  I can't locate this when I am trying to use the tool in Model Builder.  Any clues?
0 Kudos
4 Replies
JonathanQuinn
Esri Notable Contributor
It doesn't appear as though that functionality is present in the geoprocessing tool.  If you were to use the "Use selected features" button, how would you have selected those features in the source layer?  If you're selecting by attribute, you can simply add the Select By Attribute tool to the model before the Select By Location, then you can use the New Selection option for the selection type in the Select by Location tool.  If features are selected before running a geoprocessing tool, the tool will only run on those features, so by having features selected from the Select By Attribute tool, you'll only use those features as the inputs for the "Selecting Features" parameter.

That might be a bit confusing, as the word "select" is in there about 100 times, but let me know if you need any more clarification.
0 Kudos
Mary_AnneVan_Zuyle
New Contributor
I'm creating the selection using the Trace Task Tool in the Utility Network Analyst.  I have to change the options in that so that the trace creates a selection.  I guess I could go further out in the model builder to incorporate the trace task after the flag drop.  I tried to find that tool in a toolbox, but couldn't.  What I'm trying to do is help a few storm water quality inspectors identify businesses within a certain distance of catch basins upstream from known contamination in the storm drain.
0 Kudos
SolomonPulapkura
Occasional Contributor III
Maybe you can use a Feature Set to select records interactively and then pass the selection to you Select By Location.
0 Kudos
DavidCakalic
Occasional Contributor
I would also like to do something similar and noticed that the model builder tool does not have the "only use selected features" option.

What I want to do is make a tool that deletes points of one layer that are within 5 ft of ONLY SELECTED FEATURES of a polyline layer.  [We collect topographic breaklines, and we sometimes want to delete existing masspoints within set distance of collected lines.  I'd love to have this work on the fly - while a toolbar button is activated, automatically do this when a line is collected.... but I'm just going for the basics right now.]

I've been able to create a model that (if lines are selected) it will delete the appropriate points.  But if NO lines are selected it goes through my entire workspace and deletes points within 5ft of ALL lines.

Maybe model builder isn't the right place to do this?  This is a tool that I would intend to use many times throughout a day.  User manually collects line(s); if it was the last line collected it is automatically selected... otherwise they can select multiple lines; then they click a button to run this tool. --- but if they forget to make a selection I don't want it to run through the entire project and be deleting points.  (Ideally I'd also like these variables to be editable through a dialog... so if different projects have different layer names or distance setting these could be modified by the user.)
0 Kudos