Convert hole patterns from DXF file to G-Code
- phillc54
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 5723
- Thank you received: 2095
10 Jan 2016 07:19 #68148
by phillc54
Convert hole patterns from DXF file to G-Code was created 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 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.
- jtc
-
- Offline
- Elite Member
-
Less
More
- Posts: 229
- Thank you received: 13
10 Jan 2016 21:55 #68163
by jtc
Replied by jtc on topic Convert hole patterns from DXF file to G-Code
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
João
How do you implement the graphical interface? it´s my next step

João
Please Log in or Create an account to join the conversation.
- phillc54
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 5723
- Thank you received: 2095
11 Jan 2016 02:08 #68170
by phillc54
Replied by phillc54 on topic Convert hole patterns from DXF file to G-Code
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23279
- Thank you received: 4933
11 Jan 2016 10:58 #68177
by andypugh
Replied by andypugh on topic Convert hole patterns from DXF file to G-Code
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,Will drill a circle of 6 holes at a radius of 2 units and a depth of 0.126 units.
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
Please Log in or Create an account to join the conversation.
- phillc54
-
Topic Author
- Offline
- Platinum Member
-
Less
More
- Posts: 5723
- Thank you received: 2095
14 Jan 2016 22:36 #68410
by phillc54
Replied by phillc54 on topic Convert hole patterns from DXF file to G-Code
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.057 seconds