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

setParam not effect via Python API

#1
Information 
In the current version of RoboDK the "setParam" commands didn´t take effect on any kind of items.
For example the following code not work.
Code:
from robolink import *
RDK = Robolink()      # Start the RoboDK API

# How to change the number of threads using by the RoboDK application:
item = RDK.ItemUserPick("Select an item")

item.setParam("Tree", "Expand")
pause(2)
item.setParam("Tree", "Collapse")
#2
Hello,

You have to pick an item like Frame, which have other items, like Targets defined under it.
The code works except the pause instruction. Pause is used for a Pause instruction in a program. Documentation here: https://robodk.com/doc/en/PythonAPI/robo...Item.Pause




You can use this instead:
Code:
from robolink import *
import time

RDK = Robolink()      # Start the RoboDK API

# How to change the number of threads using by the RoboDK application:
item = RDK.ItemUserPick("Select an item")

item.setParam("Tree", "Expand")
time.sleep(2)
item.setParam("Tree", "Collapse")
#3
Thanks Vineet.

In the case of command "Tree" seems that works. 
I´m trying to open a robot options form using setParam.
I use the following code, but nothing happened.
Code:
from robolink import *
RDK = Robolink()      # Start the RoboDK API

# How to change the number of threads using by the RoboDK application:
item = RDK.ItemUserPick("Select a robot", ITEM_TYPE_ROBOT)
item.setParam("Form" , "open")
#4
Make sure to update RoboDK to the latest version. This Form Open/Close option was added a few months ago.
#5
(06-27-2021, 07:26 AM)Albert Wrote: Make sure to update RoboDK to the latest version. This Form Open/Close option was added a few months ago.

I´m using version 5.2.4 and Form Open still does not work, what I'm doing wrong?
"Close" seems to work, but "Open" don't do nothing!
  




Users browsing this thread:
1 Guest(s)