Select to view content in your preferred language

Input parameter as slider in Python Toolbox

522
2
Jump to solution
12-27-2022 02:59 AM
Labels (1)
Manu
by
Occasional Contributor

I wondered whether it is possible to create a Python Toolbox with a slider for GPDouble-type user input? I have found nothing so far.

Currently, the parameter in my Toolbox script is limited to the range between -1 and 1 by setting

 

 

parameter.filter.type = "GPDouble"
parameter.filter.list = [-1, 1]

 

 

but the result is simply a user input field for numeric values. If user input is outside the given range, ArcMap shows an error message to indicate the issue. However, it would be better if there was just a slider that limits possible user input right away.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

There are no sliders for Pro tools, either python or custom.  You would have to put the check in your validation script or within the calling script by  clipping the range

if -1 < x or x > 1:

 


... sort of retired...

View solution in original post

2 Replies
DanPatterson
MVP Esteemed Contributor

There are no sliders for Pro tools, either python or custom.  You would have to put the check in your validation script or within the calling script by  clipping the range

if -1 < x or x > 1:

 


... sort of retired...
BobHenry1
New Contributor

https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/parameter-controls.htm

param3.controlCLSID='{C8C46E43-3D27-4485-9B38-A49F3AC588D9}'
param3.value=60

# Set an acceptable range of 1 to 99
param3.filter.type = "Range"
param3.filter.list = [1, 99]

0 Kudos