ArcObjects Library Reference (NetworkAnalystUI)  

INetworkAnalystExtension.NetworkLayer Property

The network layer by index.

[Visual Basic .NET]
Public Function get_NetworkLayer ( _
    ByVal index As Integer _
) As INetworkLayer
[C#]
public INetworkLayer get_NetworkLayer (
    int index
);

Product Availability

Available with ArcGIS Desktop. Requires Network Analyst Extension.

Remarks

The NetworkLayer property returns the NetworkLayer referencing a NetworkDataset at the specified index in the range 0 to NetworkLayerCount - 1.

[C#]

This code shows how to get a network dataset layer by index (zero based) from the Network Analyst extension.

public INetworkLayer GetNetworkLayer(IApplication app, int index)
{
  INetworkAnalystExtension networkAnalystExtension = app.FindExtensionByName("Network Analyst") as INetworkAnalystExtension;
  return networkAnalystExtension.get_NetworkLayer(index);
}
[Visual Basic .NET]

This code shows how to get a network dataset layer by index (zero based) from the Network Analyst extension.

Public Function GetNetworkLayer(ByVal app As IApplication, ByVal index As Integer) As INetworkLayer
  Dim networkAnalystExtension As INetworkAnalystExtension =  app.FindExtensionByName("Network Analyst")
  Return networkAnalystExtension.NetworkLayer(index)
End Function

See Also

INetworkAnalystExtension Interface

.NET Samples

Subset network evaluators (Code Files: SubsetHelperUI)