Dear All.
Below is the code for con opertor in arcmap.
When i execute it gives me the error.Pls suggest and show to me where is something wrong.
rasModel = New RasterModelClass
rasModel.BindRaster(slopeRDN, "slope")
strExpression = "Con" + "(" + """" + "[slope]" + """" + ">" + "0" + "," + """" + "[slope]" + """" + "," + "0.000001" + ")"
rasModel.Script = strExpression---error throw on this line
Error:010084 invalid command or expression.
thanks in advance
Dear All.
Below is the code for con in map aljebra.
When i execute it gives me the error.Pls suggest and show to me where is something wrong.
rasModel = New RasterModelClass
rasModel.BindRaster(slopeRDN, "slope")
strExpression = "Con" + "(" + """" + "[slope]" + """" + ">" + "0" + "," + """" + "[slope]" + """" + "," + "0.000001" + ")"
rasModel.Script = strExpression
rasModel.execute()
Error:010084 invalid command or expression.
thanks in advance
Why don't you just you the expression below? There is no need to divide the expression into small parts and then concatenate it. The raster [slope] should not be in between quotes.
Con([slope] > 0, [slope], 0.000001)