I'm trying to use ArcGIS Pro's Arc Hydro toolbox in a stand alone script. I'm having difficulty importing the toolbox even when sitting in ArcGIS Pro's Python window. I'm running ArcGIS Pro 2.8.1 and I have tried both the 2.8.1 and 2.8.6 versions of ArcHydro. I can run tools from the Arc Hydro tool box in ArcGIS Pro but I need to automate my process using a script.
I think I found a work around. Instead of importing the tool box and using that path to the tool I have a more direct path to the tools that I need. I imported the script file directly and follow the logic in the code block under "if(__name__=='__main__'):" and that seems to work. I'll have to confirm that it works for the other operations that I need to do.
import drainagelineprocessing as d oProcessor = d.DrainageLineProcessing() oProcessor.bCallFromPYT = False params = (r"H:\workspace\streamstats\02_post_editor\1501\15010005\strlnk", r"H:\workspace\streamstats\02_post_editor\1501\15010005\hydrodem_data.gdb\fdr", r"H:\workspace\streamstats\02_post_editor\1501\15010005\hydrodem_data.gdb\D3test", r"H:\workspace\streamstats\02_post_editor\1501\15010005\hydrodem_data.gdb\D3test_tbl") tResults = None tResults = oProcessor.execute(params, None)