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.
- Start Visual Studio, open the solution file, then build the solution. Be sure to open Visual Studio "As Administrator."
- Start ArcCatalog and select an appropriate network dataset to work with.
- Add a new restriction attribute to the network dataset.
- Set SelectionRestriction as the evaluator type for all participating network sources for this new restriction attribute.
- Start ArcMap and add your network dataset to the map.
- Click Yes when prompted, to add the network dataset's source feature classes to the map.
- 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.
- Create a selection of the features that you want to restrict from your analysis.
- Solve your network analysis layer.
SelectionRestrictionEvaluator.cs | The custom evaluator. |
SelectionRestrictionEvaluatorEditor.cs | The custom evaluator editor. |
SelectionRestrictionEvaluator.vb | The custom evaluator. |
SelectionRestrictionEvaluatorEditor.vb | The custom evaluator editor. |
Download the files for all languages
See Also:
Programming with ArcGIS Network Analyst extensionWhat is ArcGIS Network Analyst extension?
What is a network dataset?
Geodatabase
About the ArcGIS Network Analyst extension tutorial
NetworkAnalyst
ArcGIS Network Analyst extension Object Model Diagram
An overview of the network analyst toolbox
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic: Network Analyst | ArcGIS for Desktop Basic: Network Analyst |
ArcGIS for Desktop Standard: Network Analyst | ArcGIS for Desktop Standard: Network Analyst |
ArcGIS for Desktop Advanced: Network Analyst | ArcGIS for Desktop Advanced: Network Analyst |