This document is archived and information here might be outdated.  Recommended version.


NetworkAnalystExtension Class (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalystUI > ESRI.ArcGIS.NetworkAnalystUI > Classes > N > NetworkAnalystExtension Class
ArcGIS Developer Help

NetworkAnalystExtensionClass Class

The extension for network analysis.

Product Availability

Available with ArcGIS Desktop. Requires Network Analyst Extension.

Interfaces

Interfaces Description
IActiveViewEvents (esriCarto) Provides access to events that occur when the state of the active view changes.
IConnectionPointContainer (esriDisplay)
IDocumentEvents (esriArcMapUI) Provides access to events that occur in ArcMap.
IExtension (esriSystem) Provides access to members that define an extension.
IExtensionConfig (esriSystem) Provides access to members that describe an extension.
INALocationEditOptions Provides access to location edit options.
INetworkAnalystExtension Provides access to the network analyst extension.
INetworkAnalystExtensionEvents Provides access to events triggered by the network analysis extension.
IPersistStream (esriSystem)

Remarks

The NetworkAnalystExtension is an ArcMap application extension that manages the current NetworkLayer and provides access to the NAWindow and the NALayers

There are methods to get

[C#]

This C# example shows three ways of how you can get the Network Analyst Extension.

// Get Network Analyst Extension by name
public INetworkAnalystExtension GetNetworkAnalystExtensionByName(IApplication app)
{
  return app.FindExtensionByName("Network Analyst") as INetworkAnalystExtension;
}
// Get Network Analyst Extension by ProgID
public INetworkAnalystExtension GetNetworkAnalystExtensionByProgID(IApplication app)
{
  UID uid = new UIDClass();
  uid.Value = "esriNetworkAnalystUI.NetworkAnalystExtension";
  return app.FindExtensionByCLSID(uid) as INetworkAnalystExtension;
}
// Get Network Analyst Extension by CLSID
public INetworkAnalystExtension GetNetworkAnalystExtensionByCLSID(IApplication app)
{
  UID uid = new UIDClass();
  uid.Value = "{C967BD39-1118-42EE-AAAB-B31642C89C3E}";
  return app.FindExtensionByCLSID(uid) as INetworkAnalystExtension;
}
[Visual Basic .NET]

This VB.NET example shows three ways of how you can get the Network Analyst Extension.

' Get Network Analyst Extension by name
Public Function GetNetworkAnalystExtensionByName(ByVal app As IApplication) As INetworkAnalystExtension
  Return app.FindExtensionByName("Network Analyst")
End Function
 
' Get Network Analyst Extension by ProgID
Public Function GetNetworkAnalystExtensionByProgID(ByVal app As IApplication) As INetworkAnalystExtension
  Dim uid As UID =  New UID() 
  uid.Value = "esriNetworkAnalystUI.NetworkAnalystExtension"
  Return app.FindExtensionByCLSID(uid)
End Function
 
' Get Network Analyst Extension by CLSID
Public Function GetNetworkAnalystExtensionByCLSID(ByVal app As IApplication) As INetworkAnalystExtension
  Dim uid As UID =  New UID() 
  uid.Value = "{C967BD39-1118-42EE-AAAB-B31642C89C3E}"
  Return app.FindExtensionByCLSID(uid)
End Function