I am a total newbie, I have written a handful macros through CNC control software for my lathe and see how powerful they can be. I would like to create them through something like notepad with a box for variable/measurement assignments to coincide with different gcode macros for gcode moves. I have been playing around with the debugging portion of python and I can get the variables to function the way that I would like. I am having a hard time envisioning how to get this install into a program with a variable box that measurements can be assigned to the variables. Maybe write macros in open office and have code post in notepad? I have been teaching programming to myself over the past few years when using my cnc machines, I am sure I am thinking about the process incorrectly as I lack all fundamentals. Any help is much appreciated

Thanks, Sorry, I know I am all over the map and using the wrong terms to describe things. In a nutshell. I would like to create a program that will create simple tool-path based on measurements that would be input into a "Boxes" (not sure if that is the right term) . Like a box (Length) and input your measurement in another box next to it (2.75") these would be associated with different Macros for different commonly used simple tool-path like pocketing etc... Where would I store the Macros to be called on? Where should I be looking for a program template to build this onto. Is this what QT is? I guess I was thinking I could use Notepad or Open Office. Hope it makes a bit more sense, I have a lot more reading to do. Thanks

Thanks for the reply. Gcode is grid coordinates for example. X would move a tool from left to right and Y front to back. There is also a Z axis but I am leaving it out. Code for a 2" by 2" square would be.

A macro for a lathe to remove a certain amount of material might have a user assigned name like M19 and behind the M19 call in the gcode would be these arguments. You would utilize data input boxes to fill the variable measurements.

Fleck wrote: The second piece of code is the macro represented by, in my case an "M19" within the Gcode.

I get that part, but what happens with it?

If you want to run a python script, have that code generated and saved to a file, you can use any GUI toolkit to get the inputs from the user(or you can just get them from the terminal...)If you want the generated code to be inserted into code you're editing, I would recommend using an editor that supports extending with python(such as sublime text or vim), and writing a simple plugin for it.

Thanks very much for the information, I think this points me in the right direction and is the information I am looking for. I would like to have the knowledge to be able to do both.

I get that part, but what happens with it?

I would like a user to be able to choose commonly used products in my industry that need to be installed into precisely cut pockets from a program, then they can input machine position information (machine Zero) and desired depth of cut. This would save time for the user because they can change the product route/cut without effecting the rest of the Gcode on the fly without having to walk away from the machine back to the CAM program or hand input G code