Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
API improved move commands Sep 15, 2019
Example improved move commands Sep 15, 2019
TesterProject Added missing Socket Extension and added tester project Jun 24, 2019
.gitignore Added Nupkg file May 6, 2019 doc udpate Jun 30, 2018

RoboDK API for C#

Read the RoboDK API description for general information about the RoboDK API.


  • Visual Studio (it works with the Visual Studio community version and .NET framework >= 2.0)
  • RoboDK

How to install

The RoboDK API for C# can be installed and used in one of the following ways:

  • Simply include RoboDK.cs file to your project from the Example folder
  • Install the NuGet package from the API folder The NuGet package follows the C# naming conventions and interfaces (including its own documentation) whereas the single file RoboDK.cs API follows the Python API naming.


Depending on what version of the API you use:

The single file RoboDK.cs API is available as a template on Visual Studio Marketplace

Video Overview

Robot programming using the RoboDK API for C#

C# Example

// RDK holds the main object to interact with RoboDK.
// RoboDK starts when a RoboDK object is created.
RoboDK RDK = new RoboDK();

// Select the robot among all available robots (there is no popup if there is only 1 robot)
RoboDK.Item ROBOT = RDK.ItemUserPick("Select a robot", RoboDK.ITEM_TYPE_ROBOT);

// retrieve the reference frame and the tool frame (TCP) as poses
Mat frame = ROBOT.PoseFrame();
Mat tool = ROBOT.PoseTool();

/// Optional: set the run mode 
/// (define if you want to simulate, generate the program or run the program on the robot)
// RDK.ProgramStart("MatlabTest");

// Program start
ROBOT.setPoseFrame(frame);  // set the reference frame
ROBOT.setPoseTool(tool);    // set the tool frame: important for Online Programming
ROBOT.setSpeed(100);        // Set Speed to 100 mm/s
ROBOT.setZoneData(5);       // set the rounding instruction 
                            // (C_DIS & APO_DIS / CNT / ZoneData / Blend Radius / ...)
for (int i = 0; i <= n_sides; i++)
    double angle = ((double) i / n_sides) * 2.0 * Math.PI;
    Mat pose_i = pose_ref * Mat.rotz(angle) * Mat.transl(100, 0, 0) * Mat.rotz(-angle);
    ROBOT.RunInstruction("Moving to point " + i.ToString(), RoboDK.INSTRUCTION_COMMENT);
    double[] xyzwpr = pose_i.ToXYZRPW();
You can’t perform that action at this time.