Jump to content

How to get the generated g-code file while designing plugin


starlee0514
Go to solution Solved by GregValiant,

Recommended Posts

Posted · How to get the generated g-code file while designing plugin

I've just write a python script that can modify g-code file and add functional text. To simplify the whole workflow, I'd want to turn it into a cura plugin and modify the generated g-code file at instance. Is there any resource to learn? THX

  • Link to post
    Share on other sites

    Posted · How to get the generated g-code file while designing plugin

    There are "Plugins" that are integrated into Cura and can affect the slicing and/or what goes on in the front end.  "Mesh Tools" would be an example of one of those.  They are generally available in the MarketPlace and need to be installed.

     

    There are "Post Processors" that are simpler scripts that alter the gcode after slicing.  They are selected from "Extensions | Post Processing | Modify Gcode" menu on an "as needed" basis.  PauseAtHeight.py would be an example of one of those.

     

    I guess the question becomes; at what point in the process would you need your changes to be made?

  • Link to post
    Share on other sites

    Posted (edited) · How to get the generated g-code file while designing plugin

    Thanks for your reply, the script function is to add M118 command after every ";LAYER:" command. Since the command context would be different due to different layer, the add g-code at every layer isn't suitable.

    Edited by starlee0514
  • Link to post
    Share on other sites

    • Solution
    Posted · How to get the generated g-code file while designing plugin

    "Display Info on LCD" will be included in the next release of Cura.  Adding the M118 line as:

    ;LAYER:0
    M106 S0
    M117 1/37 | ET 2h 6m
    M118 1/37 | ET 2h 6m

    Is one of the things it will do.

     

    Unzip the file and place the "DisplayInfoOnLCD.py" file into your Configuration Folder and the "scripts" sub-folder.  It will be available with the other post processors.

     

    DisplayInfoOnLCD.zip

    • Like 1
    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.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 26 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...