Jump to content

Replacement pattern with {...} won't get replaced


Uwe11

Recommended Posts

Posted (edited) · Replacement pattern with {...} won't get replaced

Hi there,

 

I have some strange behavior when slicing, which is probably just because I don't see my mistake. I'm using some custom start code. One of the lines contain for example 

M140 S{material_bed_temperature_layer_0}

  

My expectaion would be to see something like "M140 S60" in the sliced G-Code file, but what I see is for example this:

 

;FLAVOR:Marlin
M73 P0
M117 Time Left 0h40m33s
;TIME:2433
;Filament used: 1.01777m
;Layer height: 0.1
;MINX:79.625
;MINY:74.192
;MINZ:0.1
;MAXX:150.375
;MAXY:144.942
;MAXZ:27.65
;POSTPROCESSED
;Generated with Cura_SteamEngine 4.10.0
M82 ;absolute extrusion mode
; Ender 3 Start G-Code
M501                                                                   ; Standardwerte laden
M82                                                                      ; absolute Extrusion
M117 Vorbereiten                                                         ; Info am LCD
M107                                                                   ; Bauteil-Lüfter aus
M140 S{material_bed_temperature_layer_0}                   ; Bett heizen
M104 S180                                                                        ; Düse vorwärmen

 

There is no M140 from Cura before my start code. That basically indicates that Cura recognized that I have own temperture settings in my start code. Fine!
But why do I still see the variable name instead of the value?

 

And an additional question: is there a posibility to make an easy calculation in custom start code? Somthing like "M140 S{material_bed_temperature_layer_0} + 15.0" ?

Thanks!

Edited by Uwe11
  • Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    To answer the second part of your question: no, there is no way to do simple math with the replacement patterns.

    • Thanks 1
    Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    I don't see why/how the pattern replacement is not working from the snippet you posted; the spelling seems correct.

    Can you save a project file (using File -> Save project...) and post a link to it here? Then I can have a look at your exact start gcode, as well as any postprocessing and other settings that could affect this.

  • Link to post
    Share on other sites

    • 4 months later...
    Posted · Replacement pattern with {...} won't get replaced

    I have exactly the same problem. My start code I have used on earlier versions ie 4.9 and earlier and the {settings-key} has been replaced with the correct value into the Gcode. I am using Linux Mint 18.3 Sylvia and hence using the appimage.

  • Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced
    18 hours ago, adlong said:

    I have exactly the same problem.

     

    I'll ask the exact same question then:

    On 7/8/2021 at 10:01 PM, ahoeben said:

    Can you save a project file (using File -> Save project...) and post a link to it here? Then I can have a look at your exact start gcode, as well as any postprocessing and other settings that could affect this.

     

  • Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    Good morning @adlong and @ahoeben.

     

    Adlong - One typo can ruin your whole day and two can make things twice as difficult.

     

    G1 Y5.1 X200.0 Z0.28 F{print_speed] E15    ; Draw the first line

     

    There are two things here.

    1. The ending square bracket is one typo and is interfering with ALL the replacements.
    2. {print_speed} doesn't exist as a keyword.  {speed_print} would work but it's in mm/sec rather than mm/min.  What you are trying to do can't be done at this time.  There are a couple of requests on GitHub for a replacement keyword in mm/min but it hasn't happened yet.

    What it appears you want is for the line to read:

    G1 Y5.1 X200.0 Z0.28 F3600 E15

     

    What you get with the curly brackets fixed and "speed_print" inside will be:

    G1 Y5.1 X200.0 Z0.28 F60 E15

    which is 1mm/sec and will be extremely slow.

    • Like 1
    Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    Thank you. The code now works. the typo and wrong keyword must have occurred when editing whil trying to reduce speed of lines for elastic material

  • Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    I have a second Ender 3 Pro installed in Cura for TPU.  The StartUp Gcode is the only difference and that was to account for the print speed of the purge lines.

  • Link to post
    Share on other sites

    Posted · Replacement pattern with {...} won't get replaced

    Greg. I have now deleted the purge lines and now just use a skirt with a minimum length, or make a brim big enough.

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