RobotStudio event

How to access current TCP position via PCSDK?

i tried

Controller.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.Tool)

but i get an exception.

Is there another way to get the current TCP position?

Best