Hi Luke
Thanks for getting back to me. I don't seem to have the following directory under C Drive: %AppData%\Python\Python27\site-packages.
I've run the script tool within ArcMap and ArcCatalog with success. I tried Copy As Python Snippet and ran it within the ArcMap Python Interpreter:
import arcpy
import GeoHMSTools
arcpy.CentroidalLongestFlowpath_geohms(in_subbasin_features="E:/Python/Temp/Model02/Model02.gdb/Layers/Subwatershed",in_centroid_features="E:/Python/Temp/Model02/Model02.gdb/Layers/Centroid",in_longestflowpath_features="E:/Python/Temp/Model02/Model02.gdb/Layers/LongestFlowPath_2D",out_centroidallongestflowpath_raster="E:/Python/Temp/Model02/Model02.gdb/Layers/CentroidalLongestFlowPath1")
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'CentroidalLongestFlowpath_geohms'
As you can see the syntax is different for some reason or other, than when I call the tool from within the ArcMap Python Interpreter:
import arcpy
import GeoHMSTools
GeoHMSTools.CentroidalLongestFlowpath(r'E:\Python\Temp\Model02\Model02.gdb\Layers\Subwatershed', r'E:\Python\Temp\Model02\Model02.gdb\Layers\Centroid', r'E:\Python\Temp\Model02\Model02.gdb\Layers\LongestFlowPath_2D', r'E:\Python\Temp\Model02\Model02.gdb\Layers\CentroidalLongestFlowPath2')
Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts\GeoHMSTools.py", line 125, in CentroidalLongestFlowpath raise e ExecuteError: System.Runtime.InteropServices.COMException (0x8002000A): Out of present range. (Exception from HRESULT: 0x8002000A (DISP_E_OVERFLOW)) at ESRI.ArcGIS.esriSystem.IStepProgressor.set_StepValue(Int32 Step) at ESRI.APWR.HECGeoHMS10.GPCentroidalLongestFlowPath.CentroidalLongestFlowpathWk(ApLayers apLayers, Int32 debug, ITrackCancel& trackcancel, IGPMessages& messages, String& exMessage) Failed to execute (CentroidalLongestFlowpath).
I have found that although the GeoHMSTools.CentroidalLongestFlowpath() failed, if I open the results window and open the failed script and rerun it, it completes successfully.