Exporting a PathShape to GCODE
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
Exporting a PathShape to GCODE
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.
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
Re: Exporting a PathShape to GCODE
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.
If anyone knows a way to write it to a file using the GUI that'd be more convenient, but this works for now.
-
- Posts: 328
- Joined: Tue May 28, 2019 10:51 am
Re: Exporting a PathShape to GCODE
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.
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.
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
Re: Exporting a PathShape to GCODE
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.
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.
-
- Posts: 99
- Joined: Thu Oct 22, 2020 11:19 pm
Re: Exporting a PathShape to GCODE
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)
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)