Jump to content

How to access printer settings from Cura post-processing plugin?


Sporech

Recommended Posts

Posted · How to access printer settings from Cura post-processing plugin?

Hi All,

 

There are a few properties of the printer setup and slicer settings which I need to access from my post-processing plugin, such as nozzle diameter, line width etc.

Can these be accessed from the post-processing script environment?

 

Many thanks

  • Link to post
    Share on other sites

    Posted · How to access printer settings from Cura post-processing plugin?
    24 minutes ago, Sporech said:

    Hi All,

     

    There are a few properties of the printer setup and slicer settings which I need to access from my post-processing plugin, such as nozzle diameter, line width etc.

    Can these be accessed from the post-processing script environment?

     

    Many thanks

    Yep. The strech post processing script does something like that https://github.com/Ultimaker/Cura/blob/master/plugins/PostProcessingPlugin/scripts/Stretch.py#L519

    There are probably more scripts that do it as well.

  • Link to post
    Share on other sites

    Posted · How to access printer settings from Cura post-processing plugin?

    I believe you can query all those settings from the Global Container Stack.  Here's some code I've used to get the layer height setting:

     

    from UM.Application import Application
    ...
    layerHeight = Application.getInstance().getGlobalContainerStack().getProperty("layer_height", "value")

     

    It looks like "line_width" and "machine_nozzle_size"should also be an available settings. 

     

    I'm not sure where to find a definite listing of the setting names, but I was able to find these by looking through this file here: https://github.com/Ultimaker/Cura/blob/master/resources/definitions/fdmprinter.def.json

     

    But, that was just sort of a wag.

     

    Good luck!

    • Like 1
    Link to post
    Share on other sites

    Posted · How to access printer settings from Cura post-processing plugin?
    1 hour ago, bradk3 said:

    I believe you can query all those settings from the Global Container Stack. 

    Layer height is a global setting, and can be queried from the global container stack; other settings, such as the line width, can be different per extruder, so you have to get them from the extruder stack.

     

     

    from cura.Settings.ExtruderManager import ExtruderManager
    ...
    extruders = ExtruderManager.getInstance().getActiveExtruderStacks()
    line_width= extruders[0].getProperty("line_width", "value")

     

     

    • Like 2
    Link to post
    Share on other sites

    • 1 year later...
    Posted · How to access printer settings from Cura post-processing plugin?

    @ahoeben

     

    Hi, how to query a user-defined setting?

     

            retraction_amount = Application.getInstance().getGlobalContainerStack().getProperty(
                "retraction_amount", "value"
            )

     

    The above code gives me the 'default' value, not the updated value, which I changed in Cura, and I was wondering how to access the InstanceStack (?), where user-defined settings are kept.

     

    Thanks in advance!

  • Link to post
    Share on other sites

    Posted · How to access printer settings from Cura post-processing plugin?

    Retraction amount is a per-extruder setting, and must be queried from the current extruder stack

     

     

    from cura.Settings.ExtruderManager import ExtruderManager
    ...
    extruders = ExtruderManager.getInstance().getActiveExtruderStacks()
    line_width= extruders[0].getProperty("retraction_amount", "value")
  • Link to post
    Share on other sites

    Posted · How to access printer settings from Cura post-processing plugin?

    Thanks a lot!🙂

  • 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

      • 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
          • Thanks
          • Like
        • 3 replies
      • 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
    ×
    ×
    • Create New...