Select to view content in your preferred language

Value list missing model tools exported to python scripts?

515
1
01-30-2020 11:28 PM
AyokunleAdebisi1
New Contributor III

Hello community, I built a tool with builder, however, i exported it python script to add more functionalities, but the script only shows the parameters but the list of values under each parameters is not displayed. I need it to display because that is where I want to set functionalities or is there any other way to edit such? please let me know ASAP. Thanks

This what my script looks like

import arcpy

# Script arguments
Sitename = arcpy.GetParameterAsText(0)
if Sitename == '#' or not Sitename:
    Sitename = "All locations" # provide a default value if unspecified

Category = arcpy.GetParameterAsText(1)
if Category == '#' or not Category:
    Category = "Gänse" # provide a default value if unspecified

Species = arcpy.GetParameterAsText(2)
if Species == '#' or not Species:
    Species = "Graugans" # provide a default value if unspecified

Month = arcpy.GetParameterAsText(3)
if Month == '#' or not Month:
    Month = "September" # provide a default value if unspecified

Start_Year = arcpy.GetParameterAsText(4)
if Start_Year == '#' or not Start_Year:
    Start_Year = "2000" # provide a default value if unspecified

End_Year = arcpy.GetParameterAsText(5)
if End_Year == '#' or not End_Year:
    End_Year = "2006" # provide a default value if unspecified

That is my value list on the right.

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

When you created your original tool you had to add your list values to a value list property of the parameter when you set up the tool interface. This is part of the interface and not the code behind the model, so will not export.

You basically have to do it again when you set up the script tool interface.

0 Kudos