ArcObjects Library Reference (NetworkAnalystUI)  

INetworkAnalystExtension.CurrentNetworkLayer Property

The current network layer.

[Visual Basic .NET]
Public Property CurrentNetworkLayer As INetworkLayer
[C#]
public INetworkLayer CurrentNetworkLayer {get; set;}

Product Availability

Available with ArcGIS Desktop. Requires Network Analyst Extension.

Remarks

The CurrentNetworkLayer property returns the currently selected NetworkLayer in the Network Dataset dropdown control on the Network Analyst Toolbar.

[C#]

This code shows how to get the current network dataset layer from the Network Analyst extension.

public INetworkLayer GetCurrentNetworkLayer(IApplication app)
{
  INetworkAnalystExtension networkAnalystExtension = app.FindExtensionByName("Network Analyst") as INetworkAnalystExtension;
  return networkAnalystExtension.CurrentNetworkLayer;
}
[Visual Basic .NET]

This code shows how to get the current network dataset layer from the Network Analyst extension.

Public Function GetCurrentNetworkLayer(ByVal app As IApplication) As INetworkLayer
  Dim networkAnalystExtension As INetworkAnalystExtension =  app.FindExtensionByName("Network Analyst")
  Return networkAnalystExtension.CurrentNetworkLayer
End Function

See Also

INetworkAnalystExtension Interface