Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Run program according to user input

#1
Hello,

I have a question regarding calling a program in API.

Below is a picture of what I have right now in the simulation (the .html file and .rdk file are also attached in this post):


There are two programs in this simulation, one is to pick the blue box (PickBlue) and the other is to pick the red box (PickRed). I want to create a user pop-up button where users can press either "blue" or "red", and after the user selected a color in the pop-up tab, then the corresponding program runs. I would like to ask if this is achievable? If so, how? My first idea is to use the API and call the program in, but I am not sure if this is the correct direction and also not sure how to do it with the API.

Thank you very much in advance!


Attached Files
.zip pick_robo.zip(Size: 2.02 MB / Downloads: 294)
#2
Hi Robo,

Yes, it's the right approach.

首先,正如API是用python编写的,我们可以e the Python library TKinter to create the little popup windows you are referring to.

You can then trigger any program call from the API.
Here's the link to the documentation.
There's a lot of examples to help you get started.
//www.sinclairbody.com/doc/en/PythonAPI/intro.html

Hope it helps.
Jeremy
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.






Users browsing this thread:
1 Guest(s)