AnsweredAssumed Answered

HEC-GeoHMS: Importing HEC-GeoHMS Toolbox

Question asked by Playa on Jan 31, 2016
Latest reply on Jan 30, 2017 by Playa

I need assistance in importing HEC-GeoHMS Toolbox into Python. I haven't been able to find any examples of the correct syntax to import and use the tools within the HEC-GeoHMS Toolbox. The code below is based on export a model from ModelBuilder with one of the HEC-GeoHMS tools within it. It keeps telling me that there are no arguments. Any help will be appreciated.


Created on Feb 1, 2016

@author: PeterW
import arcpy

# import HEC-GeoHMS toolbox
arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Toolboxes\GeoHMS Tools.tbx")

# set input arguments
Subbasin = r"E:\Python\ModelBuilder\Model01.gdb\Layers\Watershed"
Centroid = r"E:\Python\ModelBuilder\Model01.gdb\Layers\Centroid"
LongestFlowPath = r"E:\Python\ModelBuilder\Model01.gdb\Layers\LongestFlowPath_2D"
Output_Centroidal_Longest_Flow_Path = r"E:\Python\ModelBuilder\Model01.gdb\Layers\CentroidalLongestFlowPath2"

# determine the centroidal longest flowpath
arcpy.AddMessage("Processing Centroidal Longest Flowpath")
arcpy.CentroidalLongestFlowpath_geohms(Subbasin, Centroid, LongestFlowPath, Output_Centroidal_Longest_Flow_Path) #@UndefinedVariable


The error message that I receive is attached below: