Machsupport Forum
Mach Discussion => Mach Screens => Topic started 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)
-
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
:)
-
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...
-
Try adding a delay before the regen, like maybe sleep(1000)
-
Tried it, no change...
value = GetParam("Boundry")
if value = 1 then
SetParam "Boundry" , 0
Else
SetParam "Boundry" , 1
End If
sleep(1000)
dobutton(160)
-
It should be
DoOemButton rather than just DoButton.
Hood
-
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
-
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
-
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
-
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!
-
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
-
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.