Button (Macro) - Call *.exe

Here is where you can drop off Examples of WORKING macros,plugins,Gcode programs , macro Wizards etc.
Please give a brief description of what it is and how it works.

Button (Macro) - Call *.exe

Postby Robertspark » Thu Aug 03, 2017 1:40 pm

Similar principle to the call (open) usermanual PDF.

.... this one just starts a program of your choosing from a UCCNC screenset button press, in this case Sheetcam (obviously won't work for you directly unless you have sheetcam ..... hence change it to the program of your choosing [vectric, autocad, stepper motor tuning software [leadshine protuner from the diagnostics screen] etc...

Code: Select all
System.Diagnostics.Process Sheetcam = new System.Diagnostics.Process();
Sheetcam.StartInfo.FileName = @"C:\Program Files (x86)\SheetCam TNG Development\SheetCam TNG Development.exe";
Sheetcam.Start();
Attachments
M20001.txt
(202 Bytes) Downloaded 5 times
Rob

Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
UC400eth, UC300eth, UCCNC v1.2042, Neuron Lite.
UCCNC Macro Manual
Robertspark
 
Posts: 390
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Button (Macro) - Call *.exe

Postby dezsoe » Thu Aug 03, 2017 2:05 pm

The same technique to use your favorite text editor to edit g-code. Edit screen and change "Edit file" buttonnumber from 126 to 20126. In M20126.txt change the path to your favorite text editor.

Code: Select all
// 126 -> 20126 -> external code editor

string sFileName = exec.mainform.filenametoload;

if ((sFileName == "") || (sFileName == Application.StartupPath + "\\Contents\\Empty.txt"))
{
  AS3.Additemtolistbeginning("No file loaded!", 2);
  return;
}

System.Diagnostics.Process proc;
proc = System.Diagnostics.Process.Start(@"C:\Program Files (x86)\PSPad editor\PSPad.exe", sFileName);
proc.WaitForExit();

exec.mainform.loadfile();
Attachments
M20126.txt
(446 Bytes) Downloaded 3 times
dezsoe
 
Posts: 120
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to UCCNC TOOL BOX

Who is online

Users browsing this forum: No registered users and 2 guests