Using the traversal result to select source features


PurposeThis sample command shows how you can use the NATraversalResult object. In this example, it selects the features in the map that correspond to features that were traversed during analysis to get to the point where the user clicked.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio and open the solution file.
  2. Build the solution.
  3. Start ArcMap.
  4. Click Customize, then Customize Mode.
  5. Click the commands tab.
  6. Scroll down to Network Analyst.
  7. Drag the tool corresponding to this sample up to the Network Analyst toolbar.
  8. Open a map document that contains a network dataset and the network dataset's source feature classes.
  9. If the document does not have a network analysis layer, create one by opening the Network Analyst toolbar and clicking Network Analyst, then New Service Area.
  10. Perform network analysis.
  11. Click a point on the network that was traversed. The features that were traversed to get to the point that was clicked should be selected.

SelectFeaturesTool.cs Code for the command to select the features that were traversed to get to where the user clicked.
Config.esriaddinx Add-in configuration file.
Download the C# files
SelectFeaturesTool.vb Code for the command to select the features that were traversed to get to where the user clicked.
Config.esriaddinx Add-in configuration file.
Download the VB.NET files

Download the files for all languages

See Also:

Programming with Network Analyst
What is Network Analyst?
What is a network dataset?
Geodatabase
About the Network Analyst tutorial
NetworkAnalyst
Network Analyst Object Model Diagram
An overview of the network analyst toolbox




Development licensing Deployment licensing
ArcView: Network Analyst ArcView: Network Analyst
ArcEditor: Network Analyst ArcEditor: Network Analyst
ArcInfo: Network Analyst ArcInfo: Network Analyst