Changing MotionStatement positions during simulation

Hello.
Here is problem I have faced during my project programming (I’m using KUKA Sim).
I have KUKA robot with defined “Main” and “PickBox” routines. Robot awaits input 1 True signal, then call “PickBox”. “Pick box” is simple routine with default pre-pick, pick (some signal actions), after-pick points. They are defined in relation to robot base 1. Robot base 1 is located on the conveyor end. Feeder feeds boxes (with randomized width, height, length) to conveyor, conveyor moves box until it triggers raycast sensor, which stops conveyor and sends True signal to robot input 1. Until now, everything works as intended.
Because boxes have random linear sizes, I need to adjust (some translateRel operations) pre-pick, pick and after-pick positions in “PickBox” routine, so robot would grab the box by the center of box to surface. To implement such behavior, I have defined robSignalHandler, which reacts to robot input 10. Conveyor, when box enters it’s Path container, reacts by means of OnTransition event, and sends True signal to robot input 10. As reaction, required transformation with pre-pick, pick, after-pick Statetement.Positions[0] are performed. I can see how the points are changing their position in 3d view. This happens before box reaches the sensor. When box eventually reaches the sensor, robot routine “PickBox” is called. But robot moves ignoring adjusted point positions, it uses positions how they were before the transformation.
So, I’m trying to understand, what I have to do to update the point positions during simulation, so robot would not ignore them? May be I should call specific method for Statements which points were adjusted?
I have tried to adjust positions themselves, as well as, adjusting the robot base 1 value, keeping positions unchanged.

from vcScript import *
from vcHelpers.Robot2 import *
import vcMatrix 

def printMatrix(mat):    
  for Vec in [mat.N,mat.O,mat.A,mat.P]:      
    print ("%3.3g\t%3.3g\t%3.3g\t%3.3g\n"%(Vec.X,Vec.Y,Vec.Z,Vec.W))

def get_base_position(base_name):
  bases = robot.Controller.Bases
  for base in bases:
    if base.Name == base_name:
      print("Found [" + base_name + "] base")
      return base.PositionMatrix

def OnSignal( signal ):
  pass

def OnRun():
  pass

def robSignalHandler(map, port, value):
  print("Robot signal triggered ", port, value)
  if map.Name == "Inputs":
    if port == 10 and value == True:
      box = table_container.Components[0]
      gripper.J1_ClosedValue = 800 - box.Width_Y/2

      bases = robot.Controller.Bases
      for base in bases:
        if base.Name == "Sorting table":
          new_mtx = vcMatrix.new()
          new_mtx.translateRel(box.Length_X/2, 750, -box.Height_Z)
          printMatrix(sort_table_base_pos)
          base.PositionMatrix = sort_table_base_pos * new_mtx
      #for r in robot.Executor.Program.Routines:
      #  print(r.Name)
      #routine_to_call = robot.Executor.Program.findRoutine("PickBox")
      #if routine_to_call:
        #robot.Executor.callRoutine("PickBox", False, True)
        #robot.callSubRoutine("PickBox", False, True)
      #else:
      #  print("Routine not found!")
      #mainRoutine = robot.Executor.Program.findRoutine("PickBox")
      #if mainRoutine:
      #  for index, st in enumerate(mainRoutine.Statements):
      #    print(str(index) + ": " + st.Name)
      #    st.update()
      #  new_pos = vcMatrix.new()
      #  new_pos.translateAbs(box.Length_X/2, 750, -box.Height_Z-500)
      #  mainRoutine.Statements[1].Positions[0].PositionInReference = new_pos
      #  new_pos = vcMatrix.new()
      #  new_pos.translateAbs(box.Length_X/2, 750, -box.Height_Z+130)
      #  mainRoutine.Statements[2].Positions[0].PositionInReference = new_pos
      #else:
      #  print("No Main routine found!")
  if map.Name == "Outputs":
    print(map.Name, port, value)

app = getApplication()
robot = getRobot()
robot.SignalMapIn.OnSignalTrigger = robSignalHandler
gripper = robot.Component.findNode("DUND Gripper")
for component in app.Components:
  if "DundConveyor" in component.Name:
    if component.LastConveyor == True:
      print("Pick table found: ", component.Name)
      pick_table = component
table_container = pick_table.findBehaviour("OneWayPath")
sort_table_base_pos = get_base_position("Sorting table")