DraftSight Professional: G-Code and CNC Machines

There’s a hidden gem within DraftSight Professional called the G-Code Generator. The G-Code Generator? What’s that? I hear you ask. Well, let me try to explain.

Simply put, G-Code is a computer language that tells your CNC machine how to make something. I suppose I better explain what a CNC machine is now. Well, a CNC machine is like a printer, except it doesn’t print to paper or card, it cuts or creates parts from a variety of materials such as wood, metal, plastic and so on… CNC machines are not exactly designed for the home, so they are generally only found in the manufacturing industry.

The DraftSight G-Code Generator allows you convert your drawing data to G-Code so that you can send the data to a CNC Machine. The DraftSight G-Code Generator can process lines, curves and arcs, if there are other entities in the drawing such as text, revclouds, splines and so on, it will ignore them.

The G-Code Generator supports generic G-Code, it does not have support for:

  • Arbitrary planes
    The only entities that are processed are those on the XY plane.
  • Custom post-processing for different CNC machines.

So, where can you find the G-Code Generator? Well, it’s located under the tools menu.


Click on that and the G-Code Generator Panel appears.  It looks complicated, but if you open the DraftSight Professional help file, all the commands are explained in great detail.


Obviously, if you are familiar with CNC machines and their software, then you should have no problems with the G-Code Generator and its functions. If you are curious to find out more about CNC machines, the different types and what they can do, click on this link and hopefully it will give you a better understanding: http://www.technologystudent.com/cam/camex.htm

Now, I know I said above that CNC machines are generally only found in the manufacturing industry, but there are many projects on the internet detailing how to make your own CNC machine. These are perfect for the hobbyist or small business in need of producing small etchings, pcb boards, metal parts and so on. If you have an interest in CNC, I would suggest checking these projects out.

The G-Code Generator might not be for every DraftSight user, but it is an excellent addition to the software. And, whilst I’m not a CNC expert (it’s not exactly my field of expertise) I am somewhat familiar with the process, and having spoken with people who use CNC Machines on a daily basis, they are excited by the DraftSight support for G-Code. If they are excited, then I’m excited!

Discover more about DraftSight and how you can boost your productivity with DraftSight Professional, a powerful 2D design solution for professionals that includes productivity tools and an API.



Featured image courtesy of Roland Josch / Public Domain Pictures
MJ Smyth
The first time I used CAD, it was on a DOS PC with an 8088 processor, 640K of memory and a Hercules Mono Graphics Card... That, well that was a long long time ago.I switched to DraftSight the day it was released and haven't looked back!
MJ Smyth

Latest posts by MJ Smyth (see all)

  • Johan Settersjö

    I have a lot experience from Licom Alphacam advanced metal 2,5d CAM. It is a very fast system when you don’t have a drawing file to begin with. Epecially suitible for old CNC milling machines which is time-consuming to program otherwise. An open source post processor makes it possible to tailor-made your CNC-program.
    How the G-Code Generator in DraftSight Professional works I haven´t figured out yet.

  • Brent Hannah

    I just purchase Draftsight professional, and as far as I can tell so far the Gcode generator doesn’t work very well (or at all). I can generate code on 2 or 3 straight lines, but anything more complicated than that it does nothing. No message, no timer, just … nothing. The reset zoom in the gcode window also does nothing. A little dissapointed so far.

  • Johan Settersjö

    Yesterday I updated to Draft Sight Professional 2017. The G-Code generator does’nt work at all.
    I want to engrave some text in a CNC-milling machine.

    1. I open my dwg file.

    2. I open the 2D G-Code Generator.

    3. I click the “Generate” – button.

    4. Command window: “Select one or more enteties” .

    5. I select the text, and right click.

    6. Command window: “Selected objects: 1” .

    7. Nothing happens…. -Why???

    Regards Johan

  • Hi Johan and Brent, sorry to hear that you’re having trouble with the G-Code functionality. To better help us understand this issue and find a solution, could you post this to our community in the iQuestions section so our experts can take a look? http://spr.ly/61818zFgc

  • Hi, I purchased the pro version because of the g-code option. First impresion: Indeed it seems to generate g-code. But it is rather creative with the Z-values. That is: it ignores the Z-values I implemented in the drawing with Properties->Geometry. https://uploads.disquscdn.com/images/76833bb4d981650ec3ce5d565dd2041ed689fdaf4d1801a9cab18d7effcb616d.png https://uploads.disquscdn.com/images/023f0eaea853de4557eb9e157419c83c5f48e38e1cc2710f016c279f8d5eaae1.png https://uploads.disquscdn.com/images/d7b178a3d994cd98f6f3daedaed84e8ceb09fc1f3b821dc044b0943ef9d1619a.png https://uploads.disquscdn.com/images/a580a0a64d9c6a720f5905742d64bb893ef3f0df5d744b5b37aaecc371ebb3e2.png
    The 3rd picture is what I get and the 4rth picture is what I would like tot get.
    Need help.

    • Marco Leizza

      Hi Japp, I’m Marco Leizza. User Experience for DraftSight. I would like to understand more about the workflow you are using when you use the Gcode tool and apply z values. For example, when do you apply the Z values in Properties?

      If you could give me a step by step process of your work flow, that woul be extremely helpful in me helping to improve the process.

      Much appreciated!!

      Marco Leizza

      DraftSight User Experience

      • HI Marco, thanks for answering. I need to mill a slope in CNC. It is simple really. A line goes from point A (x1,y1,z1) to point B (x2,y2,z2). Normally in 2D, z would stay 0 of course, but as I need to mill a slope, in my case z1=0 and z2=-2.0. That’s all. Fortunately in DraftSight you can change the z-values in Properties->Geometry. That is great, but when I try to generate g-code, that value is ignored and that’s a pity because the option to generate g-code directly from CAD is really brillant and for me makes Draftsight stand out, but it is not quite as useful as it could be. So what I would like is that every point is defined by x,y,and z value and not just by x and y. It would also be nice if the values entered in preamble and postscript etc…, would be remembered. Thanks for looking into the matter. regards, Jaap