I have written the following script but I cannot manage to create the drop-down list for the variable "select" (select=arcpy.GetParameterAsText(3)). Any suggestions?
# Script arguments
inputRaster = arcpy.GetParameterAsText(0)
cost = arcpy.GetParameterAsText(1)
bene = arcpy.GetParameterAsText(2)
#import Raster
rast = Raster(inputRaster)
#make calculations
rast1 = rast / rast.maximum
rast2 = 1-(rast / rast.maximum)
#Save the output rasters
rast1.save(cost)
rast2.save(bene)
#create a list from rasters
namelist = [rast1,rast2]
select = namelist
#select from a drop-down list
select = arcpy.GetParameterAsText(3)
#Script arguments
weight = arcpy.GetParameterAsText(4)
output = arcpy.GetParameterAsText(5)
#make calculations
selected = Raster(select)
ws = selected * weight
ws.save(output)
I have defined the "select" as "string", is it correct? Also, I have made some edits in validation tab.
select
in two places, perhaps inadvertently.