Tuesday 30 July 2019

arcmap - How to create parameter windows for custom geoprocessing tools?


I would like to create a geoprocessing tool with a custom GUI for its input data. To put it in other words: imagine that your client works mainly with arcmap documents and he already has an arcpy script which deals with the geoprocessing. Unfortunately he doesn't like building blocks which take parameters for the script (drop-down list, onelineinput etc.) and would like to have a custom input method like let's say a scrollbar (f.e. for selecting time interval instead of typing it manually or selecting from a list).


Is it achievable in ArcMap to have custom input GUI elements? I'm pretty sure it's not, but my colleague swears on everything that he's seen something like that.


Before I completely cross out that idea I wanted to have a confirmation from people who have spent more time working with ArcGIS. To my understanding the only solution is to create a standalone application using Runtime SDK or ArcObjects/ArcEngine.



Answer



I think that if you are creating a Python script tool, your options are limited to what user interfaces ESRI provides for each type of parameter.


I think it is possible to create custom geoprocessing tool controls, but not without ArcObjects and COM.



If you don't need to use the geoprocessing framework, you could use whatever UI library you want (Windows Forms, WPF, Java Swing, Qt, Wx, Tk, etc.).


If you are comfortable using Python and want to try creating a Python add-in with a custom GUI, this example should get you going:


Screenshot of Mark Cederholm's wxPython demo add-in


Note: I dunno what happened there with the button being cut off :)


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...