Jump to content
Ultimaker Community of 3D Printing Experts

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


Uwe11
 Share

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
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 11 replies
    ×
    ×
    • Create New...