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: 355)
#2
Hi Robo,

Yes, it's the right approach.

First, as the API is written in python, you can use 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.
https://robodk.com/doc/en/PythonAPI/intro.html

Hope it helps.
Jeremy
Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


  




Users browsing this thread:
1 Guest(s)