DXF lines straight to GCode

Need help, or want to share a macro? Post here!
CoderMusashi
Posts: 39
Joined: Mon Nov 19, 2018 8:26 pm

DXF lines straight to GCode

Postby CoderMusashi » Fri Dec 06, 2019 10:56 pm

These two macros take a single selected line from an imported DXF file and generate the Gcode to cut in step down fashion along the line. It ask for the depth you want to cut, step down amount, tool diameter, which side of the tool the line will be on when you go clockwise or counter clockwise.One of the macros is for selecting lines you cut in the X direction the other is for lines who's cut path is in the Y directions.

NOTE depth of cut is positive number because the G code generated a Z- assuming the top of the part is Z0. Change the macros file variable (located at the top of the macros code) to save the GCode where you want it. There is no lead in or lead out but that is not an issue if you know G code and find and replace in a text editor or you draw your lines longer for the lead in an lead out.
Step 1. Import DXF
Step 2. Select a line
Step 3. Run macro X or Y depending on the line you selected
See the pics for example of an X line and Y line
Looking to do holes / drilling routines check the code here https://forum.freecadweb.org/viewtopic.php?f=22&t=41435
While you are at it check out the real power of FeatureArea tool https://forum.freecadweb.org/viewtopic.php?f=36&t=41781
Attachments
2DmeY.FCMacro
(3.03 KiB) Downloaded 18 times
2DmeX.FCMacro
(3.1 KiB) Downloaded 15 times
YLineProfile.png
YLineProfile.png (142.56 KiB) Viewed 502 times
XLineProfile.png
XLineProfile.png (134.24 KiB) Viewed 502 times