1. Introduction

This documentation presents the RoboDK API for Python. With the RoboDK API you can create robot simulations and generate brand-specific programs for robots using a universal programming language. Whereas you can use the graphical user interface to create programs, you can extend RoboDK capabilities using a programming language such as Python.

The RoboDK API for Python integrates all the offline programming features of the RoboDK simulator and allows you to deploy automated applications for a large variety of robots and mechanisms.

Brief introduction to the RoboDK API for Python:
Brief introduction to simulation and offline programming:
Sample application merged with RoboDK using the RoboDK API for C#:
The latest version of the RoboDK API is available on GitHub:
The RoboDK API for Python is composed of the following modules:
  • robodk: this package is the distributed entry point of the Python API. It is the common parent of all sub-packages and modules.

  • robolink: this sub-module is the link between RoboDK and Python. Any item from the RoboDK item tree can be retrieved. Items are represented by the object Item. An item can be a robot, a reference frame, a tool, an object or a specific project.

  • robomath: this sub-module is a robotics toolbox, inspired from Peter Corke’s Robotics Toolbox: https://petercorke.com/toolboxes/robotics-toolbox/. For instance, matrix operations, projection, timers, etc.

  • robodialogs: this sub-module is a dialogs toolbox. For instance, open and save file dialogs, message prompts, etc.

  • robofileio: this sub-module is a file operation toolbox. File properties, CSV, FTP, etc.

  • roboapps: this sub-module is a RoboDK Apps toolbox. More info here: https://github.com/RoboDK/Plug-In-Interface/tree/master/PluginAppLoader

With the RoboDK API, it is possible to simulate and program robots for applications as simple as pick and place or as complex as synchronizing the movements of many robots. RoboDK API example using Python:

from robodk.robolink import *       # import the robolink library (bridge with RoboDK)
RDK = Robolink()                    # establish a link with the simulator
robot = RDK.Item('Robot')           # retrieve the robot
robot.setJoints([0,0,0,0,0,0])      # set all robot axes to zero

target = RDK.Item('Target')         # retrieve the Target item
robot.MoveJ(target)                 # move the robot to the target

# calculate a new approach position 100 mm along the Z axis of the tool with respect to the target
from robodk.robomath import *       # import the robomath library (robotics toolbox)
approach = target.Pose()*transl(0,0,-100)
robot.MoveL(approach)               # linear move to the approach position

The same script used for simulation can be used for offline programming, which means that the appropriate program can be generated for the robot being used. RoboDK supports a large number of robot controllers and it is easy to include compatibility for new robot controllers using Post Processors. A quick overview of RoboDK Processors is provided in the following video: https://robodk.com/help#PostProcessor

1.1. How to install

To install the robodk package for Python manually, type:

pip install robodk

When you run programs from RoboDK you don’t need to have the RoboDK API for Python installed as RoboDK automatically sets the Python path to the RoboDK/Python folder which contains the required modules.

More information available in the PyPi page:

RoboDK uses the Python IDLE editor by default. It is possible to change these settings to automatically use Notepad (installed with RoboDK), Visual Studio Code or Pycharm in the menu:

  • Tools-Options-Other

More information here:

RoboDK uses Python 3 by default. The robodk package is also compatible with Python 2.

Download and install RoboDK if don’t have RoboDK: https://robodk.com/download Follow these steps to verify if Python is working properly:

  1. Start RoboDK

  2. Select Program-Add Python Program. A new Python item will appear called Prog1

  3. Double click the new Python program. A message should be displayed, provoked by an error raised inside the script. The message should list all items available in the station.

  4. Right click the new program and select “Edit Python script” to modify it.


If a different message is displayed it means that RoboDK does not detect Python. If Python was installed properly it is possible to adjust the following settings for RoboDK to use Python properly: Tools-Options-Other

1.1.1. Windows

If you already installed RoboDK for Windows you should have Python 3 installed. If you didn’t install RoboDK with the Python option checked, install Python from the following link: https://www.python.org/downloads/windows/

1.1.2. Mac

RoboDK and Python must be installed separately on Mac computers. Download Python for Mac here: https://www.python.org/downloads/mac-osx/
Python 2 might be already installed on recent Mac computers. In that case it is not required to install Python.

RoboDK uses the folder /RoboDK/Python as PYTHONPATH for the modules.

1.1.3. Linux

RoboDK and Python may have to be installed separately on Linux. Download Python for Linux here:

Python 2 is installed by default with Ubuntu. In that case it is not required to install Python.

RoboDK uses the folder /RoboDK/Python as PYTHONPATH with the corresponding modules.

1.2. RoboDK API for Matlab

A Matlab version of the RoboDK API is available here:

1.3. RoboDK API for C#

A C# version of the RoboDK API is also available (based on the Nuget package). More information here:

1.4. RoboDK API for C++

A C++ version of the C++ API is available here: