Select to view content in your preferred language

Input parameter as slider in Python Toolbox

766
3
Jump to solution
12-27-2022 02:59 AM
Labels (1)
Manu
by
Regular 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

3 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
Emerging 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]

RossSmail
Regular Contributor

nice - thanks for posting this, it appears this functionality was introduced in 3.1, which was released after the accepted answer, so that was correct at the time, but is not correct anymore.

0 Kudos