Jog Options Variables

I was not able to understand if Jog Options → Variable can be passed to post-processor.

What I need is to add a way to “override” the configuration of the post-processor.
In my post I’ve added a parameter to define some plasma behaviour:

-- touchTouchMinimumDistance
--    define the minimum coord distance between touch movements to reduce the number of touches
--    0        Disabled
--    >0       Enabled
touchTorchMinimumDistance = 50

In some jobs is necessary to change this default value directly in loaded JOG.
I’ve guessed that Job Options → Variable could be a place where define this override feature.
I’ve declared a P_touchTorchMinimumDistance of Linear type with 30 but in post, I’ve got an error for nil
when tried to check it:

   if (P_touchTorchMinimumDistance > 0) then
      touchTouchMinimumDistance = P_touchTorchMinimumDistance
      post.Text ("xxxx", P_touchTorchMinimumDistance, "\n")

In stack I can view the variable:

Am I mistaking the way?

I’ve found the help document in post editor.

There was necessary to use var.<my_var_name>

Remains to understand how check for nil :slight_smile:

Thanks for help!

Checking for nil is as easy as this:

if myVariable == nil then

Take a look at post.DefineVariable, post.DefineCustomOption and post.DefineCustomToolParam. One of them may be better for your application than defining a variable as you have done.