I am trying to create a model using ArcGIS ModelBuilder.
The model intends to display the attribute of the selected feature. I intend to select the feature using the 'select by location' option. However, I need to specify the input feature interactively (mouse click).
Can anyone guide which option/tool can help me select features interactively in ArcGIS?
-
2What is your question and what have you tried?Bera– Bera2017年11月07日 08:46:35 +00:00Commented Nov 7, 2017 at 8:46
-
1Select it before running the modelMidavalo– Midavalo ♦2017年11月07日 08:46:37 +00:00Commented Nov 7, 2017 at 8:46
2 Answers 2
To do this you would use a feature set:
Feature sets allow features to be entered interactively and immediately used as input to a model or script. This interactive data entry is done through a process similar to editing features inside ArcMap. Similarly, record sets allow tabular or attribute information to be entered interactively and immediately used as input.
Any tool that uses a feature class or table as input also accepts a feature or record set. This means that for any of these tools, the input can be entered interactively by building a simple model around the tool and changing the input data type from feature class or table to feature set or record set.
Once you have a feature set it should be possible to feed it into MakeFeatureLayer and then SelectLayerByLocation.
-
1I think feature sets allow only drawing new features, not selecting existing features.GISGe– GISGe2017年11月07日 09:35:45 +00:00Commented Nov 7, 2017 at 9:35
-
@GISGe "Any tool that uses a feature class or table as input also accepts a feature or record set."2017年11月07日 09:42:04 +00:00Commented Nov 7, 2017 at 9:42
-
Yes. It means that the digitized features are the equivalent of a feature class. As the help says, feature sets can only be used to draw features, OR to point to an existing layer (if features in this layer are already selected, the selection will be used, but you can't select interactively).GISGe– GISGe2017年11月07日 09:52:23 +00:00Commented Nov 7, 2017 at 9:52
-
@GISGe I'm reading that differently to you and have not tested it recently to be certain. The methods in your answer and Midavalo's comment are ones that I would be more comfortable with but I think this one is worth testing.2017年11月07日 11:19:05 +00:00Commented Nov 7, 2017 at 11:19
-
Well I've tested feature sets in the past, that's why I can say it won't workGISGe– GISGe2017年11月07日 11:21:13 +00:00Commented Nov 7, 2017 at 11:21
If you want to create a tool that interacts with your map, you will need to create an add-in for ArcMap. Python add-ins are probably the easiest if you're not a developer. Your add-in should contain a tool that will use a mouse event (click, move, draw, etc) as input. If you don't have any experience with Python and want something quickly operating, I think using a layer from the TOC as input parameter, and selecting your features in this layer like you would normally do, before running the tool (as suggested by @Midalvo), is the best option.
-
The Python AddIn method I used a couple of years ago to do this is at gis.stackexchange.com/q/49721/1152017年11月07日 11:37:26 +00:00Commented Nov 7, 2017 at 11:37