Exporting a PathShape to GCODE

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Exporting a PathShape to GCODE

Post by freecader2 »

Apologies if I'm missing something obvious, but I've searched the options in FC, the docs, and the forums and can't figure out how to get a PathShape saved to a file in order to machine it. Does anyone know how that's done? Thanks.
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Re: Exporting a PathShape to GCODE

Post by freecader2 »

I figured out a way to do it. Send the PathShape to the python console, then I can get the GCode using obj.Path.toGCode(), and write it to a file from there.

If anyone knows a way to write it to a file using the GUI that'd be more convenient, but this works for now.
spanner888
Posts: 328
Joined: Tue May 28, 2019 10:51 am

Re: Exporting a PathShape to GCODE

Post by spanner888 »

Once you have the job setup with your desired operations and rapids, feeds, rpms & tools, you need to do Postprocess the Job, see https://wiki.freecadweb.org/Path_Walkth ... _Impatient

In addition to creating the gcode output, this step also sets the rapids & feeds in mm/min or ipm, instead of internal values (dist/sec?) and any additional features for the selected post processor.
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Re: Exporting a PathShape to GCODE

Post by freecader2 »

That's the normal workflow to produce GCode from operations in a Path Job. But PathShapes are different- they aren't Job Operations.

PathShape is a standalone object that doesn't get included when generating GCode from a Job. That's why I'm trying to figure out a way to do it that's more convenient than scripting it.
freecader2
Posts: 99
Joined: Thu Oct 22, 2020 11:19 pm

Re: Exporting a PathShape to GCODE

Post by freecader2 »

By the way in case anyone else runs in to this, here's a command that works:

open('/path/to/gcode_output.nc','w').write(App.ActiveDocument.PathShape.Path.toGCode())

(change the filename you want it to write, and "PathShape" object name if it's named differently)
Post Reply