Allow write_gcode to provide a preamble and postamble, or allow export_gcode to write to a file

Issue #225 resolved
Todd Stellanova created an issue

From the Shell Command Reference, there appear to be two ways to export gcode from a particular geometry object:

  • write_gcode allows writing gcode to a file, but does not allow a prefix or suffix to be set
  • export_gcode allows a preamble and postable to be set, but only writes to the console

I would like to write gcode to a file with a preamble and postamble. Perhaps there's a straightforward way to reroute write_gcode to a file with Tcl? I don't see how to do it with the documented command language.

Comments (2)

  1. Juan Pablo Caram repo owner

    Since 93e2d95 you can do:

    set pre "Hello World!\nI'll be back"
    set post "Bye!"
    write_gcode my_gcode_object /tmp/output.gcode -preamble $pre -postamble $post
    
  2. Log in to comment