I have exported "Con Tool" script from ModelBuilder. The model has two input parameters one is the DEM and the second is "Long Variable". When I run the model it executes perfectly fine but as I import the script to tool box and assign the variables and type and run them the Python log shows errors. I believe the script is taking the variable name instead of its value.
How do I fix that?
This is the script:
# ---------------------------------------------------------------------------
# conmodelscript.py
# Created on: 2020-07-24 11:51:39.00000
# (generated by ArcGIS/ModelBuilder)
# Usage: conmodelscript <DEM> <Input_Value>
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Script arguments
DEM = arcpy.GetParameterAsText(0)
Input_Value = arcpy.GetParameterAsText(1)
# Local variables:
Long = "1"
Output = "C:\\Users\\92347\\Desktop\\test\\output.tif"
# Process: Con
arcpy.gp.Con_sa(DEM, Long, Output, "", "Value<=%Input Value%")
This is the model
This is how I add and run the script