Page 1 of 1

Macro to store user input and machine position

PostPosted: Sat Dec 16, 2023 5:13 am
by mjr1127@gmail.com
I'm having some difficulty writing what I'd think would be a simple macro. I've tried moving the following two functions all through the example snippets I've found but without success or progress.

There are two functions from the uccnc documentation that I would like to use ( double Xposvariable = exec.GetXpos(); & double val = exec.Question("etc"); but I do not understand how/where to put these in my code for the effect.

I'd like M5000, when called, to bring up a box/value request for an input to be stored in variable #40. I'd like the macro to also store the current x-position to variable #50. And then close, that's it. Anyone have some guidance of how to do this? Thank you

Re: Macro to store user input and machine position

PostPosted: Sat Dec 16, 2023 9:46 am
by dezsoe
Here's the macro using your first 2 lines:

Code: Select all
double Xposvariable = exec.GetXpos();
double val = exec.Question("etc");

exec.Setvar(Xposvariable, 50);
exec.Setvar(val, 40);

Re: Macro to store user input and machine position

PostPosted: Sat Dec 16, 2023 3:30 pm
by mjr1127@gmail.com
Excellent, thank you !