Can't get NetworkAnalystExtension

712
4
08-06-2010 09:20 AM
by Anonymous User
Not applicable
Original User: kivela

I need to get a hold of NetworkAnalystExtension but for some reason FindExtension always returns null.

                IExtensionManager extMgr = GetExtensionManager(); //note: extMgr is returned OK
                UID uid = new UIDClass();
                uid.Value = "esriNetworkAnalystUI.NetworkAnalystExtension";
                IExtension ext = extMgr.FindExtension(uid);

I also tried using the GUID in uid.Value but got the same null return.

Also tried using IApplication, but again it just returns null.

Any ideas?  Thanks.
0 Kudos
4 Replies
JanDuske
New Contributor
Have you tried to display all loaded extensions with a for-loop and IExtensionManager.Extension[index]? If it's not there either, it's probably not loaded...
0 Kudos
by Anonymous User
Not applicable
Original User: kivela

I put the loop in and did get "Utility Network Analyst".

Any other ideas?  Thanks.
0 Kudos
JanDuske
New Contributor
Have you tried something like
IExtension analystExtension = pIApplication.FindExtensionByName("Utility Network Analyst");

?
0 Kudos
by Anonymous User
Not applicable
Original User: kivela

That did it.  Still don't understand why the other techniques don't work.

Thanks.
0 Kudos