terastios wrote:
Thanks for the input
Is there any documentation how to make a pop up window to input the variables?
or even an example that has something similar that I can read to understand?
I took a quick look in the forum but I didn't find anything
Hi terastios,
I do my macros in VB, and I've had luck w/ the following to load a variable from an input box prompt.
The following would be a numbered macro file that I call from a specific GCode file at the file start, so that I am prompted for a 'diameter' before the GCode runs, and it is loaded into var #1.
- Code: Select all
#VB
dim newvar as double
dim newinput as string
newinput = microsoft.visualbasic.inputbox("value", "Enter new value", var1) ' I believe you will call microsoft.visualbasic.inputbox in C# also
if newinput <> "" then
try
newvar = convert.todouble(newinput)
catch 'Something went wrong, exit
'exit/bail out!
exec.code("m5")
exec.code("m0")
exec.code("M30")
exit sub
end try
messagebox.show(newvar) ' Verify the value w/ a report back.
else 'Nothing entered, quit!
'exit/bail out!
exec.code("m5")
exec.code("m0")
exec.code("M30")
exit sub
end if
exec.setvar( newvar, 1)
hope it helps a little. This reference verifies to use the VB input box for C# use:
https://stackoverflow.com/questions/97097/what-is-the-c-sharp-version-of-vb-nets-inputdialogregards
Eric