Jump to content


Run a model builder

- - - - -

  • Please log in to reply
1 reply to this topic



    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 125 posts
  • Gender:Male
  • Location:Pueblo West, Colorado
  • Interests:reading newspaper, Netflix, weather, travel
  • United States

Happy New Year to Everyone !

I am working on building a model in a Model Builder. What I am trying to do here is to run each DEM to create a slope for each quad. Then I reclassify each slope to slope breaks then make it a tempoary layer to a scratch workspace. Then resample the reclassify to Bilinear Interpolation to make the layer to a permanment layer in another workspace.

I have include the attachment that someone out there can help me ?

Reason for this is that I have to run about 30 times. It will save my time so.... I appreciate it


Robert Pollock
Las Cruces Soil Survey Office
Las Cruces, NM 88011
Videophone - 1-866-642-3890 (USA/Canada only)




  • Validated Member
  • PipPip
  • 37 posts
  • Vietnam

Provided that you have all DEM files in a folder, if you know Python scripting, you could export your model to python and put the exported codes in a for - loop like this:
(this works on ArcGIS 9.3 or 9.3.1)

[codebox]# --------------------------------------------------------------------------- # modelPython.py # Created on: Sat Jan 09 2010 11:29:49 PM # (generated by ArcGIS/ModelBuilder) # --------------------------------------------------------------------------- # Import system modules import sys, string, os, arcgisscripting # Create the Geoprocessor object gp = arcgisscripting.create() # Check out any necessary licenses gp.CheckOutExtension("spatial") gp.Workspace = "DEMfolder" # Load required toolboxes... gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx") gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx") DEMfiles = gp.ListRaster("", "GRID") for Demfile in DEMfiles: # Local variables... Input_raster = Demfile ReclassOutput = Input_raster +"Rec" MakeRLOutPut = Input_raster +"MakeRL" FinalOutput = Input_raster + "Final" # Process: Reclassify... gp.Reclassify_sa(Input_raster, "", "", ReclassOutput, "DATA") # Process: Make Raster Layer... gp.MakeRasterLayer_management(ReclassOutput, MakeRLOutPut, "", "DEFAULT", "")

# Process: Resample...
gp.Resample_management(MakeRLOutPut, FinalOutput, "", "NEAREST")

Hope this helps! :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users