Custom tool param is nil?

Having problems with or questions about SheetCam? Post them here.
Post Reply
neckro23
Posts: 4
Joined: Sun Nov 20, 2022 1:54 am

Custom tool param is nil?

Post by neckro23 »

Hi, I'm having some real basic problems with a CustomToolParam for my plasma cutter. I'm trying to define an offset to my touchoff probe value, because it can be off by a bit depending on the tool. I'm writing a custom post for this.

At the top of the post I have this:

Code: Select all

    post.DefineCustomToolParam("PlasmaTool", "Probe offset", "probeOffset", sc.unitLINEAR, 0, -20, 20)
Later on my code, in OnPenDown():

Code: Select all

    post.NonModalNumber("G92 Z", -probeOffset * scale, format)
Yet when I run the post, I get:

Code: Select all

The post has thrown an error:
... attempt to perform arithmetic on global 'probeOffset' (a nil value)
What's going on here? How do I define this as a tool parameter? I've noticed that some of the built-in post-processors do the post.DefineCustomToolParam thing twice, but I'm not sure why. The post documentation (which is extremely vague, btw) offers no insight into this.
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: Custom tool param is nil?

Post by Les Newell »

Try restarting SheetCam. DefineCustomToolParam can sometimes need a restart of SheetCam before it starts working.
neckro23
Posts: 4
Joined: Sun Nov 20, 2022 1:54 am

Re: Custom tool param is nil?

Post by neckro23 »

Les Newell wrote: Sun Nov 20, 2022 8:50 am Try restarting SheetCam. DefineCustomToolParam can sometimes need a restart of SheetCam before it starts working.
Ugh, it turns out this was the case. SheetCam gave every indication that it was parsing the post properly and added the params in the tools, but apparently requires a restart before it will actually work. Very frustrating.
Post Reply