Take note: When creating a statement through API

When creating statements programmatically through the API, the following sequence should be followed to ensure that the information is consistent.

  1. Set the Base property.
  2. Set the Tool property
  3. Set the ExternalTcp property (using property setter which is equivalent to calling SetExternalTcp with keepWorldPosition == true).
  4. Set the Target property.
  5. Set the Configuration property (for joint motion statements only.)
  6. Call SetJoints to set the individual joint values.
The IMotionTarget object can be used to compute these values.