PC SDK: Get currently used workobject while simulation

Hello,
I am new to programming in Add-Ins for ABB Robotstudio and have one question. I am trying to get the current tool position while simulating.
My target is that I want to get the to position of the TCP regarding the currently used workobject which is probably moved by an external axis. What I need is the currently used workobject, the position of the workobject and the current TCP of the robot while the simulation runs.
What I already got is the current position of the TCP (tooldata) with the RsTask.ActiveTool.Frame.GlobalMatrix instruction. But this only works, if I choose the right tool in the Home->Settings Tab. In some of my routines the workobject and the tool changes. What I really need is the current position of the active used tool and workobject in the robot.
Any suggestions?
Thanks in advance
Tagged:
Comments
First of all I want to make my situation more clear: I have a robot programm on the VC with several paths with changing workobjekts within the paths in different modules. When I start the simulation I want to read the currently used workobject from the path the robot is moving on. Active workobjects can change while simulation is running. Some of them are being moved by external axes.
So what I really need is live data from the controller and not from the station. Robotstudio must use this data somewhere to move the robots in the graphics window of the station. But I can't find any command which is able to read this probably internal data from the VC.