Posts: 21
Threads: 11
Joined: Jan 2020
Reputation:
0
Hi,
I am using the RoboDK version 5.2.4
Is there a way to start an existing station using the python API ? when executing the line RDK = Robolink(), it starts a fresh new station. However, I need to open an existing one to read the tool, frames and targets in the tree. Please let know if there is a way to do it
Best regards
Posts: 66
Threads: 0
Joined: Jan 2021
Reputation:
5
For the Python API, using RDK = Robolink() should only open a new RoboDK window if its already not open. Can you tell me which Interpreter/Development Environment are you using?
Posts: 21
Threads: 11
Joined: Jan 2020
Reputation:
0
Hi,
I am using Spyder 4 that uses python version 3.8.5, is there another command that opens the station in order to extract the data ?
I saw in the help that we can open RoboDK without the user interface (-NOUI), my goal is to open the station without the user interface, extract the data and finally close it
Please let me know if this is possible
Best regards
Posts: 21
Threads: 11
Joined: Jan 2020
Reputation:
0
Hi,
Do you have any suggestion about opening an existing RoboDK station without the user interface (-NOUI), extracting the data using python and finally close it ?
Thank you
Posts: 3,471
Threads: 2
Joined: Apr 2018
Reputation:
165
You simply have to pass the argument "-NOUI" to start RoboDK behind the scenes.
You can then use the RoboDK API normally. For example, you can use AddFile to load an RDK file.
Posts: 21
Threads: 11
Joined: Jan 2020
Reputation:
0
Niceeee, thank you very much, that worked exactly as I expected
Thank you very much for your support and congratulations for your nice software ;-)
Posts: 2
Threads: 1
Joined: Dec 2023
Reputation:
0
I wrote a test.py as following:
from robodk.robolink import * # import the robolink library
RDK = Robolink(args='/NOUI')
#RDK = Robolink()
item = RDK.AddFile(r'C:\Car20231108.rdk')
robot = RDK.Item('Doosan Robotics M0617')
target = RDK.Item('Target112')
robot.MoveJ(target)
targetJoints= robot.Joints().list()
f = open("C:\RoboDK\Python37\demofile2.txt","w")
mystr= ""
for i in range(len(targetJoints) - 1):
mystr =mystr + str(targetJoints[i]) + ","
mystr =mystr + str(targetJoints[i])
f.write(mystr)
f.close()
And I opened test.py in IDLE 3.7.4 and tried to run test.py. There was a error as follows:
==================== RESTART: C:\RoboDK\Python37\test.py ====================
Starting C:/RoboDK/bin/RoboDK.exe
EXECUTING:"/NOUI":...
RoboDK is Running...
Traceback (most recent call last):
File "C:\RoboDK\Python37\test.py", line 4, in <module>
item = RDK.AddFile(r'C:\Car.rdk')
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 1765, in AddFile
newitem = self._rec_item()
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 829, in _rec_item
buffer = self.COM.recv(8)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
>>>
Would you please help me? Thanks.