Jump to content

Does Cura support user defined macros and computation and/or logic in macros?


bellzw
Go to solution Solved by GregValiant,

Recommended Posts

Posted · Does Cura support user defined macros and computation and/or logic in macros?

I mean constructions like

 

my_macro_name = if ({material_standby_temperature, 0} > {material_standby_temperature, 1}, 1, 0) ; return 0 if 0 T0's standby temp < standby temp of T1, else return 1

M109 T{my_macro_name} S{material_standby_temperature, my_macro_name} ; wait for the coolest tool to reach standby temperature

 

so I can get, for example, for my dual extruder printer, the extruder number of the one that will be at the lower standby temperature.  I've used if ( condition, true clause, false clause) as a shorthand and example; I know there are other ways to express the concept.

 

If Cura does support these constructs, can someone point me to some documentation?  I'm aware of the list of macros at http://files.fieldofview.com/cura/Replacement_Patterns.html.

  • Link to post
    Share on other sites

    • Solution
    Posted · Does Cura support user defined macros and computation and/or logic in macros?

    The short answer is "No".  PrusaSlicer does allow math and logic in it's StartUp Gcode.  Cura doesn't support it.

    Let's say your print speed is 50mm/sec.  A line like "G1 F{speed_print}" would result in "G1 F50" rather than "G1 F3000" and "G1 F{speed_print * 60}" doesn't work.

    • Like 1
    Link to post
    Share on other sites

    Posted · Does Cura support user defined macros and computation and/or logic in macros?

    That's what I expected was the answer, since I've not seen any examples in which the replacement patterns were part of expressions.  I was aware the feature was in PrusaSlicer.  A pity it's not part of Cura.

  • 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
          • 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...