AnsweredAssumed Answered

Error in executing grid expression.

Question asked by ahsan_phy@hotmail.com on Dec 20, 2014
Latest reply on Dec 20, 2014 by Dan_Patterson

Every time i run the script i got error "Error executing the grid expression, run time error, Failed to execute (Slope). " ? What is wrong with in code ?

When i run the Slope tool in ArcGIS it's give me the same error, but when i run the script in ArcGIS python Command prompt it runs successfully what is the problem, i don't understands ?

 

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "......."

 

if arcpy.CheckExtension("spatial") == "Available":
     arcpy.CheckOutExtension("spatial")
     outraster = arcpy.sa.Slope("elevation", "PERCENT_RISE")
     outraster.save("slope_per")
     arcpy.CheckInExtension("spatial")
else:
     print "Spatial Analyst Liscence is not avaliable"

Outcomes