Hello Guest it is April 16, 2024, 06:07:55 AM

Author Topic: Display Work Envelop button in the Tool Path Ops tab  (Read 919 times)

0 Members and 1 Guest are viewing this topic.

Offline mzc

*
  •  11 11
    • View Profile
Display Work Envelop button in the Tool Path Ops tab
« on: August 18, 2021, 06:00:19 AM »
Just wondering if the Display Work Envolop button is meant to actually toggle the display of the soft limits in the tool path windows?

It did not seem to work for me so I was trying to add some lua code to do this with the API, however the API function to set this seems to do nothing.

I can turn the envolop display on and off by editing the screen set, and changing the property for the tool path widget, but surely I'm missing something here?

The "Tool Path Display Mode" that is mapped to the button as the "Left Up Action" does not seem to change the display of the limits in the toolpath, but the "Draw Limits" tick box in the tool path widget properties sure does.

Offline Stuart

*
  •  311 311
    • View Profile
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #1 on: August 18, 2021, 07:54:21 AM »
have you edited the screen set ,and selected the tool path on the left drop down there is a selection box to show the soft limits , until that is done they will not show up

got to operator and select edit screen

caveat emptor make a copy of your current screen set before you alter any thing

Offline mzc

*
  •  11 11
    • View Profile
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #2 on: August 18, 2021, 07:43:56 PM »
I can get the limits to show in the tool path windows by editing the screen set as you way,  can't get the limits to toggle on/off with the button in the tool path ops tab, or with the API and some lua code.

Offline jbuehn

*
  •  101 101
    • View Profile
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #3 on: August 19, 2021, 01:20:49 PM »
Have you tried using the scr.SetProperty() screen API? Something like...

Code: [Select]
-- Toggle work envelope
local toolpathName = "toolpath" -- the name of your toolpath screen element
local drawLimitsState = scr.GetProperty(toolpathName, "Draw Limits")
scr.SetProperty(toolpathName, "Draw Limits", drawLimitsState == "1" and "0" or "1")

Offline mzc

*
  •  11 11
    • View Profile
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #4 on: August 20, 2021, 03:43:10 AM »
Yes, thanks for that. That works fine.

I guess it makes sense that messing with strictly screen aspects of the code will not require calls to the mc. functions (core API).

This begs the question, where are the src. functions, and the Properties etc documented? I can't find the GetProperties method (if that's the right lingo for lua) documented or implemented anywhere in the installed files.
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #5 on: August 20, 2021, 05:15:05 AM »
Hi,

Quote
This begs the question, where are the src. functions, and the Properties etc documented?

To be honest I don't think they're are documented. My understanding is that they were never meant to be used outside of a testing and development
environment and would be superseded by regular .mc APIs. What information I can find on them is here:

https://www.machsupport.com/forum/index.php?topic=40051.0

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Display Work Envelop button in the Tool Path Ops tab
« Reply #6 on: August 20, 2021, 09:23:31 AM »
If you go into Mach4Hobby>ZeroBraneStudio>api>lua and open scr.lua you will see a list of all the scr. calls. Some of them are applicable to only Industrial such as the Editor ones. The ones you will be most interested in will just be scr.GetProperty and scr.SetProperty. Whatever you see in the Properties window within the screen editor for each of the controls you can get/set the values.