Hello Guest it is March 28, 2024, 10:38:41 AM

Author Topic: Trying to make Mach4 tool path window like Mach3 and failing.  (Read 612 times)

0 Members and 1 Guest are viewing this topic.

Trying to make Mach4 tool path window like Mach3 and failing.
« on: September 19, 2021, 07:37:46 PM »
I managed to make the background black, the tool path blue, and as the machine or simulation progresses it paints its position white. What I miss is when you click in the window all the previous white is cleared and the white picks up at the current position and continues until the window is clicked again. I assume for that to happen that by clicking the tool path window a "regen tool path" should be triggered to eliminate all the tool path tracking up to that point.

I would like to trigger a Regen Toolpath when clicking the tool path window to see if I get the desired effect. Is that something that needs to happen in Lua? Can this be done?

Offline mzc

*
  •  11 11
    • View Profile
Re: Trying to make Mach4 tool path window like Mach3 and failing.
« Reply #1 on: April 17, 2022, 09:16:13 AM »
Hi Steve,
I was trying to refresh the toolpath window from lua code also.

Look up mcToolPathGenerate in the Mach4 Core API docs.
rc = mc.mcToolPathGenerate(number mInst)

While the function seems to do what is advertised, I don't understand the following code's behavior 100%:

   mc.mcCntlSetLastError(inst, "Hello")
   local rc = mc.mcToolPathGenerate(inst)
   mc.mcCntlSetLastError(inst, "World")

The "Hello" is printed in the History/Debug window, but the "World" is never printed.
I'm guessing the GUI state is reset in addition to the toolpath being generated or something. The API doc's don't really help.

Subsequent GUI actions that cause History output write output as expected.

Anyone know why this is so?

Cheers,
Michael.

« Last Edit: April 17, 2022, 09:29:28 AM by mzc »