The extension for network analysis.
| Interfaces | Description |
|---|---|
| IActiveViewEvents (esriCarto) | Provides access to events that occur when the state of the active view changes. |
| IConnectionPointContainer | Supports connection points for connectable objects. |
| 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. |
| IPersistStream (esriSystem) |
| Interfaces | Description |
|---|---|
| INetworkAnalystExtensionEvents (default) | Provides access to events triggered by the network analysis extension. |
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
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;
}
This Visual Basic example shows three ways of how you can get the Network Analyst Extension.
'Get Network Analyst Extension by name
Public Function GetNetworkAnalystExtensionByName(ByVal pApp as IApplication) As INetworkAnalystExtension
Set GetNetworkAnalystExtensionByName = pApp.FindExtensionByName("Network Analyst")
End Function
'Get Network Analyst Extension by ProgID
Public Function GetNetworkAnalystExtensionByProgID(ByVal pApp as IApplication) As INetworkAnalystExtension
Dim pUID As New UID
pUID.Value = "esriNetworkAnalystUI.NetworkAnalystExtension"
Set GetNetworkAnalystExtensionByProgID = pApp.FindExtensionByCLSID(pUID)
End Function
'Get Network Analyst Extension by CLSID
Public Function GetNetworkAnalystExtensionByCLSID(ByVal pApp as IApplication) As INetworkAnalystExtension
Dim pUID As New UID
pUID.Value = "{C967BD39-1118-42EE-AAAB-B31642C89C3E}"
Set GetNetworkAnalystExtensionByCLSID = pApp.FindExtensionByCLSID(pUID)
End Function
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
When working with NetworkAnalystExtension's default outbound interface in Visual Basic 6 declare variables as follows: Private WithEvents pNetworkAnalystExtension as NetworkAnalystExtension