Convert hole patterns from DXF file to G-Code

More
10 Jan 2016 07:19 #68148 by phillc54
I recently needed to generate some odd hole patterns for drilling sheet metal and have written a small python program to read a dxf file and convert it to g-code for my sherline mill.
The holes must be circles and be on the holes layer (case is not important e.g., Holes or HOLES be OK).
Attached are the program plus a sample dxf along with the resultant ngc file.
I only use this for single hole sizes but if there are differing hole sizes it will split the code into sections of hole sizes but there is no tool change code (you could insert this manually in the output text box then save the file again).
Cheers, Phill
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
10 Jan 2016 21:55 #68163 by jtc
I had a project similar to yours, I import the holes from a dxf layer and convert it to a g83 drilling cycle. Tool number,feed,speed can edited on a xml file. I made this because the machine that I used (hurco vm2) uses a different g83 syntax so it generates 2 files, one for the hurco and the second for linuxcnc so I can see the code preview and simulation.

How do you implement the graphical interface? it´s my next step :laugh:

João

Please Log in or Create an account to join the conversation.

More
11 Jan 2016 02:08 #68170 by phillc54

Please Log in or Create an account to join the conversation.

More
11 Jan 2016 10:58 #68177 by andypugh
Just a quick tip. If you want a circle of holes, it is quite easy to MDI them using polar coordinates.

You need to touch off so the centre of the pattern is X=0 Y=0.
The G81 drilling canned-cycle takes a repeat parameter (L)

So,
G81 @2 ^60 Z-0.126 L6
Will drill a circle of 6 holes at a radius of 2 units and a depth of 0.126 units.

Please Log in or Create an account to join the conversation.

More
14 Jan 2016 22:36 #68410 by phillc54
Thanks, I do use polar coordinates in one of my NGCGUI routines.

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum