Hi there, i'm sure there is a simple answer but I haven't been able to figure it out yet.
I am trying to script some archydro processing with python. I am using the ArcHydroTools.
I am getting errors about setting the target locations so I put these lines in my code.
I am getting the following error.
Does anyone know the proper way to set Target locations? I even exported model builder into python but it didn't work because I had to change it to use ArcHydroTools.
Thanks
I am trying to script some archydro processing with python. I am using the ArcHydroTools.
I am getting errors about setting the target locations so I put these lines in my code.
Code:
RasterLoc = "C:/Users/Me/Documents/Project/ScriptHydro"
VectorLoc = "C:/Users/Me/Documents/progect/ScriptHydro/xArcHydro.gdb"
ArcHydroTools.SetTargetLocations("HydroConfig","Layers",RasterLoc,VectorLoc)
Code:
Traceback (most recent call last):
File "C:\Users\Me\Documents\Project\ScriptMethodPart2.py", line 20, in <module>
ArcHydroTools.SetTargetLocations("HydroConfig","Layers",RasterLoc,VectorLoc)
File "C:\Program Files (x86)\ESRI\WaterUtils\ArcHydro\bin\ArcHydroTools.py", line 62, in SetTargetLocations
raise e
ExecuteError: System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at ESRI.APWR.ArcHydroGPTools.AHSetTargetLocations.Execute(IArray paramvalues, ITrackCancel trackcancel, IGPEnvironmentManager envMgr, IGPMessages message) in C:\Builds\HydroSolutions\10.1_ArcHydro\Sources\ArcHydroTools\src\ArcHydroGPTools\AHSetTargetLocations.vb:line 434
Failed to execute (SetTargetLocations).
Thanks