Select to view content in your preferred language

Model Crash Help

623
0
11-02-2010 07:27 AM
JaxonHiggs
New Contributor
I've created this model in model builder and it has opened successfully previously. Now when I double-click it in my custom toolbox, ArcMap crashes. Any ideas as to what's the deal?

Here's the code exported to python from the model builder.

# ---------------------------------------------------------------------------
# gwModel.py
# Created on: Tue Nov 02 2010 09:18:07 AM
#   (generated by ArcGIS/ModelBuilder)
# Usage: gwModel <Transmissivity> <Storativity> <Water_Table> <Time__days_> <Q__gallons_per_day_> <Injection_Well_Shapefile> <Input_raster>
# ---------------------------------------------------------------------------

# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

# Set the necessary product code
gp.SetProduct("ArcInfo")

# Check out any necessary licenses
gp.CheckOutExtension("spatial")

# Load required toolboxes...
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx")
gp.AddToolbox("C:/Program Files (x86)/ArcGIS/ArcToolbox/Toolboxes/Conversion Tools.tbx")

# Script arguments...
Transmissivity = sys.argv[1]

Storativity = sys.argv[2]

Water_Table = sys.argv[3]

Time__days_ = sys.argv[4]

Q__gallons_per_day_ = sys.argv[5]

Injection_Well_Shapefile = sys.argv[6]

Input_raster = sys.argv[7]

# Local variables...
u = "C:\\Users\\Jaxon\\AppData\\Local\\Temp\\SingleOutput1"
Time_Raster = "C:\\Users\\Jaxon\\AppData\\Local\\Temp\\CreateConsta2"
Q_Raster = "C:\\Users\\Jaxon\\AppData\\Local\\Temp\\CreateConsta1"
drawdown = "C:\\Users\\Jaxon\\AppData\\Local\\Temp\\SingleOutput2"
New_Water_Table = ""
Output_Feature_Class = ""
Distance_to_Injection = ""
Output_point_features = ""

# Process: Create Constant Raster (2)...
gp.CreateConstantRaster_sa(Q_Raster, Q__gallons_per_day_, "INTEGER", "1", "0 0 250 250")

# Process: Create Constant Raster...
gp.CreateConstantRaster_sa(Time_Raster, Time__days_, "INTEGER", "", "0 0 250 250")

# Process: Raster to Point...
gp.RasterToPoint_conversion(Input_raster, Output_point_features, "")

# Process: Near...
gp.Near_analysis(Output_point_features, "''", "", "LOCATION", "NO_ANGLE")

# Process: Point to Raster...
gp.PointToRaster_conversion(Output_Feature_Class, "FID", Distance_to_Injection, "MOST_FREQUENT", "NONE", "")

# Process: Single Output Map Algebra...
gp.SingleOutputMapAlgebra_sa("(SQR(Distance to Injection) * Storativity) / (4 * Transmissivity * Time Raster)", u, "'';'';C:\\Users\\Jaxon\\AppData\\Local\\Temp\\CreateConsta2;''")

# Process: Single Output Map Algebra (2)...
gp.SingleOutputMapAlgebra_sa("(Q Raster / (4 * 3.14159265 * Transmissivity)) * LN(0.5615 / u)", drawdown, "C:\\Users\\Jaxon\\AppData\\Local\\Temp\\CreateConsta1;'';C:\\Users\\Jaxon\\AppData\\Local\\Temp\\SingleOutput1")

# Process: Minus...
gp.Minus_sa(Water_Table, drawdown, New_Water_Table)
Tags (2)
0 Kudos
0 Replies