I have an arcpy script that uses a XTools Pro geoprocessing tool, which works if I run it from ArcMap (with the XTools Pro extension enabled), but if I run it outside of ArcMap I get an error.
Tool I'm running:
arcpy.ImportToolbox("C:/Program Files (x86)/DataEast/XTools Pro/Toolbox/XTools Pro.tbx") arcpy.XToolsGP_DispersePoints_xtp(InputLayer, OutputLayer, "0.25 Meters", "1 Meters", "BY_CLUSTERS", "RING", "", "")
arcgisscripting.ExecuteError was unhandled by user code Message: Failed to execute. Parameters are not valid. ERROR 000824: The tool is not licensed. Failed to execute (XToolsGP_DispersePoints).
I have attempted to enabled this extension from arcpy with no success, and have found the XTools Pro help pages don't mention arcpy at all (so now I wonder if it's even supported).
How can I enable the XTools Pro extension from within arcpy? I've attempted to use the following, but am unsure what arcpy would call the XTools Pro extension, so may be using the incorrect Extension name. (I have tried
if arcpy.CheckExtension("XToolsPro") == "Available": arcpy.CheckOutExtension("XToolsPro") else: print "XTools Pro Not Available"