Machsupport Forum

Mach Discussion => Mach Screens => Topic started by: leversole on January 23, 2016, 02:26:53 PM

Title: Redraw toolpath
Post by: leversole on January 23, 2016, 02:26:53 PM
I hope you guys dont get pi$$ed at all of the questions, I try to search the forums and figure it out myself before I ask!  ::)

I added a button to show or hide the table boundarys, I wanted it to regen after, used the do button 160 code (same code the regen button does),
cant get it to work...

value = GetParam("Boundry")
if  value = 1 then
  SetParam "Boundry" , 0
Else
SetParam "Boundry" , 1
End If
dobutton(160)
Title: Re: Redraw toolpath
Post by: Overloaded on January 23, 2016, 03:03:52 PM
You already have the buttons on the screens that doo what you seem to be describing.
Could you just use them ?
Or, duplicate them if on a custom screen?

Russ
 :)
Title: Re: Redraw toolpath
Post by: leversole on January 23, 2016, 03:27:21 PM
I duplicated them, just trying to get one button to change AND regen the toolpath...I got the idea from a youtube mach help video...the person had one button that redrew the toolpath window whne he changed the toolpath to show the table limits....

My two buttons work like the 1024 set, jsut trying to make if one button? DOnt know why the last line (dobutton(160)) is not working...
Title: Re: Redraw toolpath
Post by: ger21 on January 23, 2016, 03:38:33 PM
Try adding a delay before the regen, like maybe sleep(1000)
Title: Re: Redraw toolpath
Post by: leversole on January 23, 2016, 04:09:26 PM
Tried it, no change...

value = GetParam("Boundry")
if  value = 1 then
  SetParam "Boundry" , 0
Else
SetParam "Boundry" , 1
End If
sleep(1000)
dobutton(160)
Title: Re: Redraw toolpath
Post by: Hood on January 23, 2016, 04:23:20 PM
It should be
DoOemButton rather than just DoButton.
Hood
Title: Re: Redraw toolpath
Post by: Overloaded on January 23, 2016, 04:44:14 PM
I duplicated them, just trying to get one button to change AND regen the toolpath...

Ah, sorry , overlooked that part.  :P

Hood's fix worked here, seems no need for the sleep then either.

Nice addition to my screen as well.
Thanks leversole,  :)
Russ
Title: Re: Redraw toolpath
Post by: leversole on January 23, 2016, 04:52:30 PM
It should be
DoOemButton rather than just DoButton.
Hood

Cool! Was looking thru the VB wiki and saw OEMButton, figured I would try it and it worked! I came back here to let everyone know, and saw your post! Also removed the sleep as not needed!

Thanks ALL
Title: Re: Redraw toolpath
Post by: Hood on January 23, 2016, 04:59:26 PM
The search can be a PITA if you don't really know what exact search words to use for the problem you face.
If you did a search for DoOemButton(160) I suspect you would come up with a post or two from years ago.
Problem is however knowing the DoOemButton(160) would likely mean you don't need to search :D


Hood
Title: Re: Redraw toolpath
Post by: leversole on January 23, 2016, 05:01:00 PM
You are right! I guess experience is the BEST teacher! It is good though tath others can learn and spark new ideas from other's exchanges!
Title: Re: Redraw toolpath
Post by: Hood on January 23, 2016, 05:05:43 PM
Here is one I came up with from 6 or so years ago :D
http://www.machsupport.com/forum/index.php/topic,12227.msg78726.html#msg78726

I can remember when I used to press the Display button it would do the regen then all of a sudden it stopped working so I had to add that code to the button. Why it ever changed I have no idea, not sure whether it originally had the DoOemButton code or whether it was automatic.
Hood
Title: Re: Redraw toolpath
Post by: ger21 on January 23, 2016, 05:13:21 PM
DoOemButton replaced DoButton many years ago.
I would suggest using DoOEMButton for everything. All the codes are in the Wiki. At least all the documented ones.