NetworkAnalystUI


Supported with:
  • ArcView with Network Analyst
  • ArcEditor with Network Analyst
  • ArcInfo with Network Analyst
Library dependencies: Version, System, SystemUI, Geometry, GraphicsCore, Display, Server, Output, Geodatabase, GISClient, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, DataSourcesNetCDF, GeoDatabaseDistributed, GeoDatabaseExtensions, Carto, NetworkAnalysis, Location, GeoAnalyst, Animation, Maplex, Geoprocessing, NetworkAnalyst, Schematic, SpatialAnalyst, 3DAnalyst, GlobeCore, EngineCore, TrackingAnalyst, Framework, Desktop.Addins, GeoDatabaseUI, DisplayUI, OutputUI, Search, Catalog, CatalogUI, CartoUI, DataSourcesRasterUI, ArcCatalog, ArcCatalogUI, ArcMap, ArcMapUI, AnimationUI, Editor, GeoReferenceUI, EditorExt, LocationUI, GeoDatabaseDistributedUI, GeoprocessingUI, OutputExtensions, OutputExtensionsUI, ArcScan

Additional library information: Contents, Object Model Diagram

The NetworkAnalystUI library provides objects for working with the Network Analyst extension in ArcMap. The library supports a number of objects that you, as a developer, can use; NetworkAnalystExtension, NAWindow, and a few geoprocessing objects are defined in the library.
 
It is not common for developers to extend this library.

See the following sections for more information about this namespace:

NetworkAnalystExtension

In ArcMap, there is an application extension provided for the Network Analyst extension. This object is the NetworkAnalystExtension. Its primary interface is INetworkAnalystExtension. Use this interface to find the currently selected network dataset and to access NAWindow.
The following code example shows how to use the NetworkAnalystExtension object to get NetworkLayer and NAWindow:
[C#]
public INetworkLayer GetCurrentNetworkLayer(IApplication app)
{
    INetworkAnalystExtension networkAnalystExtension;
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")as
        INetworkAnalystExtension;
    return networkAnalystExtension.CurrentNetworkLayer;
}

public INAWindow GetNAWindow(IApplication app)
{
    INetworkAnalystExtension networkAnalystExtension;
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")as
        INetworkAnalystExtension;
    return networkAnalystExtension.NAWindow;
}
[VB.NET]
Public Function GetCurrentNetworkLayer(ByVal app As IApplication) As INetworkLayer
    Dim networkAnalystExtension As INetworkAnalystExtension
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")
    Return networkAnalystExtension.CurrentNetworkLayer
End Function

Public Function GetNAWindow(ByVal app As IApplication) As INAWindow
    Dim networkAnalystExtension As INetworkAnalystExtension
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")
    Return networkAnalystExtension.NAWindow
End Function

NAWindow

The NAWindow object is used to manage network analysis layers and to manipulate network location objects in ArcMap. Its main interface INAWindow allows access to things such as the current analysis layer, the selected category, and the selected items. It also exposes methods—StartOperation, StopOperation, and AbortOperation—that manage editing transactions on network analysis classes within an ArcMap undo/redo operation.
The following code example shows how to use the NALayer object to get the active network analysis layer:
[C#]
public INALayer GetActiveNetworkAnalysisLayer(IApplication app)
{
    INetworkAnalystExtension networkAnalystExtension;
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")as
        INetworkAnalystExtension;
    return networkAnalystExtension.NAWindow.ActiveAnalysis;
}
[VB.NET]
Public Function GetActiveNetworkAnalysisLayer(ByVal app As IApplication) As INALayer
    Dim networkAnalystExtension As INetworkAnalystExtension
    networkAnalystExtension = app.FindExtensionByName("Network Analyst")
    Return networkAnalystExtension.NAWindow.ActiveAnalysis
End Function

Geoprocessing

Three IMDElementCtrl geoprocessing objects are defined in this library. These include the following:

See Also:

Sample: Add a traversal result to the map
Sample: Network Analyst Engine application
Sample: Export any network analysis class to a text file
How to set up a Network Analyst solve to work with the undo/redo stack