ah03hr

ArcPy Custom Tools - Accessible by the JAVA ADK Add Ins?

Discussion created by ah03hr on Feb 4, 2011
Hi, I am quite new to this.

I am trying to use Java ArcGIS Add-Ins through eclipse. I have created a combobox that consists of a drop down with the 3 options that are possible for the one single parameter of a python tool I customized with arcpy.

Is there any way to execute this tool within the combo box, or do I have to recreate the tool in Java?

I tried adding the toolbox to my eclipse project, and upon selection change, I used the selection to populate the parameter array (which, in this case, is just one string), and then tried to execute the tool. No luck. Any pointers in the right direction would be much appreciated!

(this is just the code from the onSelChange)

public void onSelChange(int cookie) throws IOException, AutomationException {
 
  GeoProcessor geoProcessor = new GeoProcessor();
  geoProcessor.addToolbox("*******catalogPath********/xy.tbx");
  VarArray parameters = new VarArray();
  if (cookie == gisOption)
  {
   String gis = "gis";
   parameters.add(gis);
  }
  geoProcessor.execute("updateDate",parameters,null);

Outcomes