Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have ILayer, how do i obtain INALayer,

if (TypeOf layer Is INALayer) is false?

I am using ArcGIS 9.3.1

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Part of This sample, among other things, shows how to get a reference to the INALayer. Basically, it goes like this:

// app is an IApplication reference
ESRI.ArcGIS.NetworkAnalystUI.INetworkAnalystExtension naExt = 
    (ESRI.ArcGIS.NetworkAnalystUI.INetworkAnalystExtension)
    app.FindExtensionByName("Network Analyst");
ESRI.ArcGIS.NetworkAnalystUI.INAWindow naWindow = naExt.NAWindow;
if (naWindow.ActiveAnalysis == null || naWindow.ActiveCategory == null)
{
    System.Windows.Forms.MessageBox.Show(
        "There must be an active analysis layer and an active category");
    return ;
}
ESRI.ArcGIS.NetworkAnalyst.INALayer naLayer = naWindow.ActiveAnalysis;
share|improve this answer
    
Can we do the same for ArcGIS Server? –  Sam007 Sep 23 '11 at 12:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.