python code for "fill tool" ??

4026
2
03-25-2015 10:58 AM
AlisonSchilling
New Contributor III

ArcGIS Help 10.1

An overview of the Hydrology toolset

select Fill

I am new to python.

the python code example for the Fill command starts with "create flow direction"  - also when I export my python code from my model that has the flow tool - I do not get the same 'syntax' ( i believe is the word I am looking for) my python code from export looks completely different then the example provided.

my python export from model

# Process: Fill

arcpy.gp.Fill_sa(Dem_Patch, temp2, "")

I am getting an error when trying to create my python code and run it.

ERROR

File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>

    return lambda *args: val(*gp_fixargs(args, True))

0 Kudos
2 Replies
AlisonSchilling
New Contributor III

of course figured out issue with the code -however the code in the examples in the training confused me a bit - the more I learn the python code, I am sure they will make sense. I am sorry I could not find where to delete a question..

0 Kudos
Luke_Pinner
MVP Regular Contributor

Instead of exporting from a model, you'll get better python output by running the tool from the ArcToolbox window, then clicking the Geoprocessing menu and opening the Results window, right click the process you just ran and select "Copy As Python Snippet".

dPkuU.png

(Image from this GIS StackExchange answer)