X-Ray and Geoprocessing

You might have found the new Geoprocessing tools in the latest X-Ray release, but you might also be wondering how to use them. It’s easy enough to run any of the tools from the X-Ray dockable window. In the example below I selected the Import Using Geoprocessing tool and then dragged files/datasets into the GP tool.

This new tool might take some time to get used to – it will add new items like missing fields and datasets, and it also gives you the options to replace all subtypes and domains since I can’t find a way to read the current values from Python… it gets around the limitation of Xml Workspace being and all-or-nothing import.

But the real point of this blog is what X-Ray is doing with the GP Tools. You might already know about the Toolboxes folder in ArcCatalog, and there are User and System Toolbox folders. When you first run the GP tools the X-Ray addIn will copy the toolbox files over to your “My Toolboxes” folder as shown below:

So now you can use those tools in any GP models or scripts simply by accessing the toolbox from that folder. PS the Alias is “XRay” so you can script the tools in python, i.e., ImportUsingGeoprocessing_XRay(…) just like you would use any other GP tool.

# Quick example exported from a GP Model
import arcpy
# Load required toolboxes
arcpy.ImportToolbox(“C:/Users/Steve/AppData/Roaming/ESRI/Desktop10.0/ArcToolbox/My Toolboxes/XRayTools.tbx”)
# Local variables:
XRayDefault1_xml = “C:\\Users\\Steve\\Documents\\ArcGIS\\scrap\\XRayDefault1.xml”
Existing_gdb = “C:\\Users\\Steve\\Documents\\ArcGIS\\scrap\\Existing.gdb”
FDS = “C:\\Users\\Steve\\Documents\\ArcGIS\\scrap\\Existing.gdb\\FDS”
# Process: Import Using Geoprocessing
arcpy.ImportUsingGeoprocessing_XRay(XRayDefault1_xml, Existing_gdb, FDS, “true”, “false”, “false”, “true”, “false”)

This entry was posted in New Stuff, Technical. Bookmark the permalink.