NetworkAnalystUI


Supported with:
Library dependencies: System, SystemUI, Geometry, Display, Server, Output, Geodatabase, GISClient, ArcWeb, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, DataSourcesNetCDF, GeoDatabaseDistributed, GeoDatabaseExtensions, Carto, NetworkAnalysis, Location, GeoAnalyst, Animation, Maplex, Geoprocessing, NetworkAnalyst, Schematic, SpatialAnalyst, 3DAnalyst, GlobeCore, Publisher, TrackingAnalyst, Framework, GeoDatabaseUI, DisplayUI, OutputUI, Catalog, CatalogUI, CartoUI, DataSourcesRasterUI, ArcCatalogUI, ArcCatalog, ArcMapUI, ArcMap, AnimationUI, Editor, GeoReferenceUI, EditorExt, LocationUI, GeoDatabaseDistributedUI, GeoprocessingUI, OutputExtensions, OutputExtensionsUI, DataSourcesSMUUI, 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.

The objects that implement this functionality are grouped into a number of library subsystems. These library subsystems are:

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

There are three IMDElementCtrl geoprocessing objects defined in this library. These include: