Selection restriction evaluator


PurposeThis sample demonstrates how to create a dynamic network evaluator that can be used by a restriction attribute in a network dataset. By using this sample, you can dynamically restrict network elements based on the currently selected network source features in ArcMap.

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, open the solution file, then build the solution.
  2. Start ArcCatalog and select an appropriate network dataset to work with.
  3. Add a new restriction attribute to the network dataset.
  4. Set SelectionRestriction as the evaluator type for all participating network sources for this new restriction attribute.
  5. Start ArcMap and add your network dataset to the map.
  6. Click Yes when prompted, to add the network dataset's source feature classes to the map.
  7. Create a new network analysis layer and make sure that your new restriction is selected under the Analysis Settings tab of the analysis layer's property pages.
  8. Create a selection of the features that you want to restrict from your analysis.
  9. Solve your network analysis layer.

SelectionRestrictionEvaluator.cs The custom evaluator.
SelectionRestrictionEvaluatorEditor.cs The custom evaluator editor.
Download the C# files
SelectionRestrictionEvaluator.vb The custom evaluator.
SelectionRestrictionEvaluatorEditor.vb The custom evaluator editor.
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