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:
Did you ever resolve this? i have the same need/problem.
Hi Thomas, Unfortunately not. I kept getting error messages. Not sure if ESRI\USACE have added python support to HEC-GeoRAS. GeoRAS might not be supported in HEC-RAS 5 as they are building their own GIS functionality directly into HEC-RAS to mitigate the need for HEC-GeoRAS.