Jump to content
Ultimaker Community of 3D Printing Experts

Post processing script for Octoprint's @pause feature

Recommended Posts

Post processing script for Octoprint's @pause feature


None of the existing pause at height scripts use the @pause feature for Octoprint to handle the pause and resume so I made a new script based off of the existing 'Pause at height' script to do that.  You can give it a height in mm or layer number to pause after printing the layer specified.  It does not add any commands like M or G for example.  It only inserts an @pause into the gcode just before the layer height or layer number which tells Octoprint to handle the pause using Octoprint's 'PAUSE and RESUME scripts.  By default Octoprint doesn't define any commands for the pause and resume scripts so you would need to put that in yourself in the Octoprint config under the PRINTER settings.  This does not use any of Cura's pause and resume scripts as it is intended to use Octoprint for the pause and resume.


99.9% of the work for this script was already done and I didn't have to add much code so a big thank you for the developer of the original script.  I removed a lot more code than added as this script only adds one @pause line to the gcode for each pause.


If you combine this with the Telegram plugin for Octoprint, you can get notifications to your phone through Telegram when your printer pauses which is really handy so that I don't have to keep monitoring the printer at the right time.


I have attached the PauseAtHeightOctoprint.py script.  On Windows you can put the PauseAtHeightOctoprint.py script in your user data directory below for Cura 3.4 and restart Cura.  I only tested this on Cura 3.4.1 but I suspect that this script would work for quite a few older versions of Cura too.  There is an api version 2 specified in the script I created this from but I don't know when Cura starting supporting version 2 of the post processing scripts.


Cura 3.4:


Other Cura versions configuration directories...



 1.3  (2018-08-23)

     Fixed a major bug where I put an incomplete version in the zip file.  It was missing an import line for UM.Application.

 1.2  (2018-08-20)

     Pulled in bug fixes from upstream PauseAtHeight script. See
 1.1  (2018-08-12)
     Fixed script to use layer counts like Cura does.  Cura starts counting layers
     as 1 even for negative layers like for the raft so we need this plugin to match the
     layer numbers as shown in Cura.
 1.0  (2018-08-12)
     Initial release 



Edited by Adam324
  • Like 1

Share this post

Link to post
Share on other sites

Updated to v 1.1 to make sure the layer number you use for the plugin matches the layer number in Cura's layer view.  The script was not including negative layers (raft for example) so that I could easily calculate half of the layers in my head when deciding what layer to pause at but not realizing that the layer number would not match what Cura shows in the layer view.  The original script was doing the right thing from Cura's perspective when showing the layers in the layer view so I made it calculate layers like the original script did.

Edited by Adam324

Share this post

Link to post
Share on other sites

Updated to v1.2.  I synced to pull in changes to the original pause at height script upstream in github.  There was a bug fix to the original pause at height script as well as some minor sentence changes to the config settings.


From the github bugfix in github:






Fix offset of initial layer height

It would detect the height of the raft by looking at what the first Z coordinate is that it encounters on layer 0. This Z coordinate also includes the initial layer height though. If you pause lower than the initial layer height (but higher than 0), you'd expect to pause in the initial layer.





Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Our picks

    • Ultimaker Cura | a new interface
      We're not only trying to always make Ultimaker Cura better with the usual new features and improvements we build, but we're also trying to make it more pleasant to operate. The interface was the focus for the upcoming release, from which we would already like to present you the first glance. 
        • Like
      • 86 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!