RobotStudio event

Get current position in

How do i get the current TCP position i like the function CRobt() in rapid code


Best Regards

Klaus Soenderhegn


  • Hi
    Something like this
    Example just writes the x value to the logg window


    Public Sub Macro_CRobt()
    Dim stn As Station = Project.ActiveProject
    If stn Is Nothing Then Exit Sub
    Dim tool As RsToolData = stn.ActiveTask.ActiveTool
    New LogMessage(tool.Frame.GlobalMatrix.t.x.ToString()))

    End Sub


    public void Macro_CRobT()
    Station stn = Project.ActiveProject as Station;
    if (stn == null) return;
    RsToolData tool = stn.ActiveTask.ActiveTool;

    Logger.AddMessage(new LogMessage(tool.Frame.GlobalMatrix.t.x.ToString()));
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering