.NET Access of Business Analyst Toolbox

2424
1
08-17-2010 11:30 AM
SteveDenowski
New Contributor
I am a novice .NET programmer so I understand I may be overlooking something very simple, but I am having difficulty in accessing tools in the Business Analyst Toolbox.

I've tried to add a reference to the toolbox via the "Add a Geoprocessing Toolbox Reference", which I understand is for custom toolboxes. While other ESRI supplied toolboxes load without a problem, the Business Analyst Toolbox has several tools that serve up an "unhandled exception error" and then finally a "member names cannot be the same as their enclosing type" error. If I try to add as an ArcGIS reference there is not way to select BusinessAnalystTools from any of Desktop ArcCatalog, Desktop ArcCatalog Extension, Desktop ArcMap, Desktop ArcMap Extension, Desktop Extension, or Server (Core).  If I try to add a reference via "Imports ESRI.ArcGIS.BusinessAnalystTools" -- I am notified by Visual Studio that it does not exist. Finally, I tried using the IGeoProcessor.AddToolbox Method which returned a runtime error " A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in ESRI.ArcGIS.Geoprocessor.dll.

So, I'm stumped.

If anyone can steer  me in the right direction, many thanks in advance.


    Steve

Steve Denowski,
Senior Analyst, GeoAnalytics, Inc.
Madison, WI.
0 Kudos
1 Reply
GarryBurgess
Esri Contributor
Hi Steve,

I assume you have seen the help here that illustrates how to add a tool by name:

http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/c4ff8b68-0410-435f-b8e5-682d5cea47cf.htm


You just need to amend the examples in the link above to also check out the Business Analyst licesne as illustrated in the GP help for each of the Business Analyst tools.  Check out the Python script example for one of the GP tools (Spatial Overlay) here:

http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Spatial_Overlay_(Business_Analyst)

The syntax will be a little different, but this does illustrate what you have to do to access a Business Analyst GP tool using .NET.

Cheers - Garry
0 Kudos