How to get joint values

I have a 6-axis robot with 3 external axis in simulation. Now I have added a IJointMotionStatement statement by code, set the target. I tried to get all the joint values by statement.JointValues but only found 3 external joint values.

below is my code:

var statement= routine.AddStatement();
var target = statement.Target;
target.SetP(new Vector3(x, y, z));
target.SetWPR(new Vector3(a, b, c));
statement.Target = target;
statement.SetExternalJoints(new [] { e1, e2, e3 });

var jointValues = statement.JointValues;

p.s. The point is reachable


I tested with the following snippet and I was able to read the robot controller’ implement values as well as the imported external values.

var robot = IoC.Get<ITeachContext>().ActiveRobot;
var jointStatement = robot.Executor.Program.AddRoutine("Sub1").AddStatement<IJointMotionStatement>();
List<double> values = new List<double>();
if (robot.RobotController.ExternalJoints.Count > 0)
foreach (double jV in jointStatement.JointValues)