Call third party GIS tool in Python

360
1
10-10-2011 08:21 AM
BondHarper
Occasional Contributor II
I would like to use functions from a third party GIS tool in Python to automate a process. Specifically I am looking to automate HEC-GeoRAS functions, but I imagine the process is the same for any third party add-in. This may be really simple, but how do I figure out how to call these functions? I have no problem with native GIS functions since they are well documented by ESRI, but often third party tools have no documentation. Thank you!!!
Tags (2)
0 Kudos
1 Reply
MarcNakleh
New Contributor III
In principle, you can use arcpy.importtoolbox to import whatever toolbox you need. You then need to analyze the items of arcpy (using something like the built-in dir function) to see what these items are called. You could try comparing the items before and after to see what's changed (and thus what was contributed by your 3rd party tool.)

Alternatively, I've had success in the past by following these (kludgy) steps if you're in ArcGIS 10:
- Import the toolbox into your ArcToolBox window
- Run the tool
- Check under Results
- Right-Click on the tool's results, and select Copy As Python Snippet

Voila: you have the executable code and tool reference!
You then need to import the Toolbox in arcpy using arcpy.importtoolbox in your Python script for automation.
I've had success with ET Geowizards and XTools this way.

Hope this helps!
0 Kudos