As a complete beginner I recently started tinkering with modelbuilder and arcpy to solve a little annoying repetitive task. The model checks the highest number in a field and shows in a small window using a python script.
I get the values thrugh a SQL search by attribute and an summary statistics. The values end up as single strings in separate branches of the model, and I feed them to the script with arcpy.GetParameter()
For now I've used this with only two values as an example:
import arcpy
import Tkinter
# Set local variables
Piano2 = arcpy.GetParameter(0)
Piano3 = arcpy.GetParameter(1)
parent_widget = Tkinter.Tk()
label_widget = Tkinter.Label(parent_widget, text= "Piano2 = " + Piano2 + "\nPiano3 = " + Piano3)
label_widget.pack()
Tkinter.mainloop()
When the tool is complete it will have around 30-60 variables that will vary depending on the situation.
What I want t do is instead of importing every value as a varaible, import a list of all values.
I tried with "collect values" and just "arcpy.GetParameter" the list but it doesn't seem to work.
Solved! Go to Solution.
Collects Values tool will return a string of semicolon separated values such as AA;BB;CC;DD.
It is up to you to split this string and process as you wish.
Example:
Collects Values tool will return a string of semicolon separated values such as AA;BB;CC;DD.
It is up to you to split this string and process as you wish.
Example:
Works perfectly! Thanks 😄