Hey, how to set base/tool using own variable

hello everyone,

I’m currently working on robot simulation using sim pro 3.1.2 where I picked up box from a conveyor and move it to a pallet.
Those boxes do have random height so I need to change the Z.value of my point.
I’m using the “set base” command into the job map window to move the pallet’s base and its Z value.
However I can’t find a way to use my own variable ("INT_random_height) inside the Z value.
Do I need to write a python script for that?

thx in advance

Did you ever figure this out? I have a very similar situation and would like to use a variable to adjust the Z value in a relative base.


You cannot tie base position matrix to a variable directly. You can control base with SetBase statement. If that’s not flexible enough then your only option is to write some python.

I attach a simple example made with VC but it runs on Kuka.Sim 3.1 as well. Only the VC motion statements don’t show up very nicely on Kuka.Sim UI. Robot has BaseShiftScript python script which creates three real properties to the robot called BASE_1_X, BASE_1_Y, BASE_1_Z. If you change those properties on UI, robot program or anywhere else the script reacts to property’s OnChanged event and copies the value from property to the first base matrix. Note that the coordinates are given as absolute values not relative. And they refer to parent node’s coordinate system so in the example model BASE_1 is attached to Block component.

You might be able to adapt this script into your use case if you are a bit familiar with python scripting. This approach is not supported in post-processing so be aware of that if you create KRL code.

BaseShift.vcmx (518.9 KB)