franzpc

Run a python script in a ModelBuilder

Discussion created by franzpc on Sep 27, 2011
I have a script in python Fill a raster tool, the code is this:

import arcpy,os,glob,sys
arcpy.CheckOutExtension("spatial")

arcpy.env.overwriteOutput=True

path=sys.argv[1]
raster=sys.argv[2]

DEM = raster

# Process: Fill
arcpy.gp.Fill_sa(DEM, path+"\\DEM_Fill", "")

Using two parameters: script of the toolbox in ArcMap, and the other in ModelBuilder add the script with parameters of the path (workspace) and raster (Raster Dataset), run and displays the error:

<class 'arcgisscripting.ExecuteError'>: Failed to execute. Parameters are not valid.
ERROR 000860: Input surface raster: is not the type of Composite Geodataset, or does not exist.
Failed to execute (Fill).

Thank you for your help.

I have ArcGIS 10.

Outcomes