I don't have the docs here, and c# is case sensitive, which you need to fix, but something like this:
double CurrentX = exec.Getfielddouble(226); // Get X DRO value
double half = CurrentX / 2;
SetField(half, 226);
ValidateField(226);
Hi.
I am new to UCCNC, and have studies the functions in UCCNC, but i would like very much to have a 1/2 X or 1/2 Y macrobutton on my screen.
A macro that gets the actual DRO position, divide it by 2 and put the result back in the DRO.
It would be a good help to have together with my edgefinder to get the center of my material.
I have done some screen editing and a macrobutton "goto Zero" for each of the axis, so dividing the DRO by 2, type it in again, and press my new macro works, but it would be great with a "X1/2" and "Y1/2" macro.
Can anyone help??
Thanks in advance
/Caul, Denmark
Similar Threads:
I don't have the docs here, and c# is case sensitive, which you need to fix, but something like this:
double CurrentX = exec.Getfielddouble(226); // Get X DRO value
double half = CurrentX / 2;
SetField(half, 226);
ValidateField(226);
Gerry
UCCNC 2017 Screenset
[URL]http://www.thecncwoodworker.com/2017.html[/URL]
Mach3 2010 Screenset
[URL]http://www.thecncwoodworker.com/2010.html[/URL]
JointCAM - CNC Dovetails & Box Joints
[URL]http://www.g-forcecnc.com/jointcam.html[/URL]
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Actually, it should be this:
For the Y axis, change 226 to 227.Code:double CurrentX = AS3.Getfielddouble(226); // Get X DRO value double half = CurrentX / 2; AS3.Setfield(half, 226); AS3.Validatefield(226);
Gerry
UCCNC 2017 Screenset
[URL]http://www.thecncwoodworker.com/2017.html[/URL]
Mach3 2010 Screenset
[URL]http://www.thecncwoodworker.com/2010.html[/URL]
JointCAM - CNC Dovetails & Box Joints
[URL]http://www.g-forcecnc.com/jointcam.html[/URL]
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Hi again.
I succeded in writing the macro's with a minor rewrite of the code:
Here are my files:
// Macro for 1/2 X
double Xposvariable = exec.GetXpos(); //Get X DRO value
double half = Xposvariable/2;
AS3.Setfield(half, 226);
AS3.Validatefield(226);
// Macro for 1/2 Y
double Yposvariable = exec.GetYpos(); //Get Y DRO value
double half = Yposvariable/2;
AS3.Setfield(half, 227);
AS3.Validatefield(227);
Last edited by caul; 12-20-2016 at 04:28 AM.
To finish my project about the X and Y 1/2 macroes, i made the buttons for the function in UCCNC.
Feel free to use them.
/Carsten