Jump to content

Recommended Posts

Posted · How to Customize "Pause at Height"

I would like to change a couple of the defaults within the PauseAtHeight.py file to numbers and/or text that I always use (Ex: default to "Layer" instead of "height", default idle temp to 205 instead of 0 - that sort of thing).  (If I'm adding stripes to a print and pausing 5 or 6 times to change colors it would be nice if I didn't have to change the same lines over and over.)

I can copy the file, rename it, and make my changes but it isn't part of the Cura install.  Is there a relatively painless way for me to add it?  

 

  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"
    5 hours ago, GregValiant said:

    I can copy the file, rename it, and make my changes but it isn't part of the Cura install.  Is there a relatively painless way for me to add it?

     

    I'm not sure what you consider a "relatively painless way", i think only a few things are important:

    • give it distinct "name" and "key" - settings (in function getSettingDataString)
    • save the modified script inside the configuration folder in the sub-folder "scripts" (create the "scripts" folder first, if it does not exist)

    Restart Cura if applicable and the script should now be visible in the list of post-processing scripts with it's new name.

     

    Subsequent installations of newer Cura versions will copy it automatically to their particular configurations, no manual steps needed.

     

  • Link to post
    Share on other sites

    Posted (edited) · How to Customize "Pause at Height"

    Thanks tinkergnome.  I had found the name and key settings and made the other changes I wanted.  I am unable to copy the new file into the scripts folder.  A pop-up appears with "Destination folder access denied" and "You need permission to perform this action.".  I tried to remove the Read Only attribute but it self-resets.  I am the administrator of the computer and I gave myself verbal permission but the computer doesn't seem to care (Windows 10 Home edition).  Do you have any ideas regarding the permission thing?

    EDIT: It was a "Sharing" thing.  I had to share the entire folder tree with myself.

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"

    A couple more things...

    The changes to the plug-in work fine.  The default is now "Layers" and a couple of other minor changes.

    1.  I rename the file and the "key" and "name" as described but as I noted above, the new GregPauseAtHeight.py doesn't show up in the dropdown list.  My workaround was to make the changes in the original file.  That's what worked.

    2.  When I ADD lines to the original file, it disappears from the drop down in Cura.  I wanted to add a beep so I would be alerted to the pause.  The lines I added are just above the the code adding the M0 line

    # Add Buzzer
                prepend_gcode += "M300\n"

    If I comment the "prepend..." line - the file shows up.  Without the # sign in front, Pause at Height disappears from the dropdown list in Cura

    Thoughts please.  I'm experienced at VBA (and Fortran IV!!) and I'm trying to muddle my way in to Visual Studio and Python.

     

  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"

    @GregValiant - can you make it easier for us please by posting the relevant code here instead of making us find the code?

     

    Comments in gcode start with semicolon.  Comments in python start with a #

  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"
    4 hours ago, GregValiant said:

    When I ADD lines to the original file, it disappears from the drop down in Cura.

     

    • If there are errors in the Python code the script will not show up.
    • You have to restart Cura after every change on post-processing scripts. All scripts are only read during the start of Cura.
    • After the start of Cura: take a look at cura.log and search for error messages that are related to your script. It's safe to delete the log file before starting (shorter file -> more clarity)
    • I'm not aware of other ways to debug post-processing scripts.
  • Link to post
    Share on other sites

    Posted (edited) · How to Customize "Pause at Height"

    Sorry for the confusion Gr5, it is the PauseAtHeight.PY that I've been customizing.

    Tinkergnome - There it was in the log - "Invalid use of tabs and spaces line 328".  An easy fix.  Now if I fall asleep in my chair the machine will wake me up.  

    Edit:

    OK.  I figured out the loading problem as well.  Renamed the attribute and it's all good.

     

    Back in the day I wrote an alpine ski race scoring program in the Excel 4.0 macro language.  When that became defunct I had to port 30,000 lines of code (actually cells of code) over to VBA.  So necessarily I learned VBA.  I think in 2001 I had code for 15 different timer models to dump their data directly into Excel.  There was no common firmware even within a manufacturer.  It was all text based but the syntax was different model-to-model.  TagHuer went one way, Alge went another, Brower a third way, etc.  Learning Python is going to be difficult as I have more unlearning to do.  Where I would like to end up is writing a standalone program for a front end for my printer (the design is done and written in VBA so I would port it over to VB or Python).  I'd consider that a good ending for a guy that started with analog computers.

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"
    16 hours ago, GregValiant said:

    Sorry for the confusion Gr5, it is the PauseAtHeight.PY that I've been customizing.

    I know but I'm too lazy to go find it and open it when I can just look at someone else's question and help them instead.  If you had posted the code here I probably would have spotted the syntax error in 1/10 the time it would take me to go find the file.  Also I'm a very fast typist so asking you to post the file is easier than finding it myself, lol (I'm always forgetting where the files are stored).  Also you would be helping other people who are reading this thread (like tinkergnome) save a few seconds of their time as well.

  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"

    I can do that.

    In this case my problem was with invisible characters.  That would have been a tough one to "see".

  • Link to post
    Share on other sites

    Posted · How to Customize "Pause at Height"

    Oh!  I'm glad you figured it out then!

  • 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 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...