Jump to content

Cura's List of Tokens / Keywords


inventabuild

Recommended Posts

Posted · Cura's List of Tokens / Keywords

Is there a list of Cura's Tokens / Keywords that I can use in my preSwitchExtruder.gode, postSwitchExtruder.gcode, start2.gcode and end2.gcode? I found some of them like "{print_bed_temperature}" for example. A complete list would be helpful for customizing my code to improve my prints.

  • Like 2
Link to post
Share on other sites

Posted · Cura's List of Tokens / Keywords

Here's a list from Jonathon, the developer of KS. It is as of the released version, but I believe there may be new tokens in the Beta versions. Please don't ask me to interpret, as I find the writing a bit confusing too.

-------------------------------------------------------------------------------------------------------

Kisslicer tokens

Most parameters can have an offset, parsed as any number after the TOKEN

is the same as is the same as is the same as

E.g. If is valued at 100, then = = 115

Some offsets are parsed as integers, specifically the extruder , temperature , and bed temp tokens

the Material token does not have an offset

Position tokens

is the current X position, and so on for and

is the current extruder's position

these are useful for making small relative adjustments...move up a bit, retract a bit, etc.

because KISSlicer does not know if these values have been modified by the G-code includes, it will reset the values right after the include code is inserted

Extruder and Temperature control

is the extruder

this is base 0, as in the 1st extruder is 0. If you need it to be a 1, you can use

'Prefix' and 'Select Extruder' will have evaluate to the next extruder to be used

All other inserts will have evaluate to the just used extruder

is the temperature of the extruder

'Select Extruder' KISSlicer will substitute the correct temp (first layer or regular) as needed

'Deselect Extruder' will select the Keep-Warm temp if the extruder will be used again, or 0 if it just finished it's final extrusion of the print

if the final 0 is undesired (like you want to keep your extruder hot for the next print), you can hack around it by using or something, with the material settings being 100C less than you actually want to use.

is the bed temperature in the material settings

If used in 'Prefix' it will resolve to the material of the first extruder to be used in the print

if used in 'Select Extruder' it will resolve to the material that is about to be used

in all other G-code inserts, it will resolve to the most recently used material

Other

<%> will resolve to the percent done estimate at that point in the print (using the timing estimates, so it should be decently accurate). It will have one decimal place (e.g. 17.3), and will be 0 in 'Prefix', 100 in 'Postfix', and guaranteed to be between those for all other inserts. Also, for some reason, I allow an offset

is inserts the include text in the Material settings 'Matl G-code'

This lets you do something custom for each material type

Any G-code tokens inside it will also be replaced (I have not tried recursive tokens, but I think KS will ignore them)

  • Like 1
Link to post
Share on other sites

Posted (edited) · Cura's List of Tokens / Keywords

eldrick,

Do Tokens / Keywords exist for Cura?

Also, is there a list of the variables that Cura uses.  For example I can use M104 T0 S{print_temperature} to set the temp of extruder 1 and M104 T1 S{print_temperature2} to set the temperature of extruder 2.  Where is there a list of the variable names that shows {print_temperature}, {print_temperature2} and the other variables that Cura uses.  I would like to know the variable names so I can use them in my Cura g-code.

Edited by Guest
  • Link to post
    Share on other sites

    • 3 weeks later...
    Posted · Cura's List of Tokens / Keywords

    If they're looking to see if there's interest, then I'm replying because I would like to have a list of these tokens also. As a programmer, knowing tokens is a must, and how they operate is a requirement. Internally, from existing code we can see this is valuable information. As a developer it's priceless. I would like to have a list of tokens also. So far, people keep telling me there are other slicer printers to use; but, I'm stubbornly continuing to use Cura because I produce nice prints with simple tweaking of parameters. I've only been printing a week, and already my starting and ending gcode is growing for more control and better results with verious profiles for various behaviors. The longer I do this, the less the likelihood I'll migrate. I see they're quick to add changes, so far, to keep customers satisfied; I hope this will be one of them.

    So, I would love to see a set of tokens or internal fixed variables that I could use in developing GCODE in Cura!

  • Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    The point is mostly that we have a brand new shiny version of Cura that does things differently. We see the issue with wanting to modify / make plugins for Cura, so we redid pretty much everything and made sure that this would be possible.

    So with the old Cura you could pretty much change only the g-code, with the new one you can change a lot more (view modes, tools, input / output devices, etc)

  • Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    Every single setting can be used as {tag}, so just save a profile as an ini file, look at all the names in there, that's everything you can use (and there are a few extras, but there are in the default start code already)

  • Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    ;M117 {layer_height}

    ;M117 {wall_thickness}

    ;M117 {retraction_enable}

    ;M117 {solid_layer_thickness}

    ;M117 {fill_density}

    ;M117 {nozzle_size}

    ;M117 {print_speed}

    ;M117 {print_temperature}

    ;M117 {print_temperature2}

    ;M117 {print_temperature3}

    ;M117 {print_temperature4}

    ;M117 {print_temperature5}

    ;M117 {print_bed_temperature}

    ;M117 {support}

    ;M117 {platform_adhesion}

    ;M117 {support_dual_extrusion}

    ;M117 {wipe_tower}

    ;M117 {wipe_tower_volume}

    ;M117 {ooze_shield}

    ;M117 {filament_diameter}

    ;M117 {filament_diameter2}

    ;M117 {filament_diameter3}

    ;M117 {filament_diameter4}

    ;M117 {filament_diameter5}

    ;M117 {filament_flow}

    ;M117 {retraction_speed}

    ;M117 {retraction_amount}

    ;M117 {retraction_dual_amount}

    ;M117 {retraction_min_travel}

    ;M117 {retraction_combing}

    ;M117 {retraction_minimal_extrusion}

    ;M117 {retraction_hop}

    ;M117 {bottom_thickness}

    ;M117 {layer0_width_factor}

    ;M117 {object_sink}

    ;M117 {overlap_dual}

    ;M117 {travel_speed}

    ;M117 {bottom_layer_speed}

    ;M117 {infill_speed}

    ;M117 {solidarea_speed}

    ;M117 {inset0_speed}

    ;M117 {insetx_speed}

    ;M117 {cool_min_layer_time}

    ;M117 {fan_enabled}

    ;M117 {skirt_line_count}

    ;M117 {skirt_gap}

    ;M117 {skirt_minimal_length}

    ;M117 {fan_full_height}

    ;M117 {fan_speed}

    ;M117 {fan_speed_max}

    ;M117 {cool_min_feedrate}

    ;M117 {cool_head_lift}

    ;M117 {solid_top}

    ;M117 {solid_bottom}

    ;M117 {fill_overlap}

    ;M117 {perimeter_before_infill}

    ;M117 {support_type}

    ;M117 {support_angle}

    ;M117 {support_fill_rate}

    ;M117 {support_xy_distance}

    ;M117 {support_z_distance}

    ;M117 {spiralize}

    ;M117 {simple_mode}

    ;M117 {brim_line_count}

    ;M117 {raft_margin}

    ;M117 {raft_line_spacing}

    ;M117 {raft_base_thickness}

    ;M117 {raft_base_linewidth}

    ;M117 {raft_interface_thickness}

    ;M117 {raft_interface_linewidth}

    ;M117 {raft_airgap_all}

    ;M117 {raft_airgap}

    ;M117 {raft_surface_layers}

    ;M117 {raft_surface_thickness}

    ;M117 {raft_surface_linewidth}

    ;M117 {fix_horrible_union_all_type_a}

    ;M117 {fix_horrible_union_all_type_b}

    ;M117 {fix_horrible_use_open_bits}

    ;M117 {fix_horrible_extensive_stitching}

    ;zzz bad

    ;M117 {machine_name}

    ;M117 {machine_type}

    ;M117 {machine_width}

    ;M117 {machine_depth}

    ;M117 {machine_height}

    ;M117 {machine_center_is_zero}

    ;M117 {machine_shape}

    ;M117 {ultimaker_extruder_upgrade}

    ;M117 {has_heated_bed}

    ;M117 {gcode_flavor}

    ;M117 {extruder_amount}

    ;M117 {extruder_offset_x1}

    ;M117 {extruder_offset_y1}

    ;M117 {extruder_offset_x2}

    ;M117 {extruder_offset_y2}

    ;M117 {extruder_offset_x3}

    ;M117 {extruder_offset_y3}

    ;M117 {extruder_offset_x4}

    ;M117 {extruder_offset_y4}

    ;M117 {steps_per_e}

    ;M117 {serial_port}

    ;M117 {serial_port_auto}

    ;M117 {serial_baud}

    ;M117 {serial_baud_auto}

    ;M117 {extruder_head_size_min_x}

    ;M117 {extruder_head_size_min_y}

    ;M117 {extruder_head_size_max_x}

    ;M117 {extruder_head_size_max_y}

    ;M117 {extruder_head_size_height}

  • Link to post
    Share on other sites

    Posted (edited) · Cura's List of Tokens / Keywords

    Doesn't  {print_temperature2} - {print_temperature5} work anymore? I only get a temperature for {print_temperature}. And does someone know if there is a token/keyword for the filament color?

     

    Edited by Jay_Johnson
  • Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    Replacement patterns from these legacy Cura versions do not work anymore (AFAIK). Be aware that this thread is nearly 5 years old...


    Here is an example (extruder temperatures) for more recent Cura versions:

     

     

  • Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    This is the list of current replacement patterns:

    http://files.fieldofview.com/cura/Replacement_Patterns.html

    • Like 3
    Link to post
    Share on other sites

    Posted · Cura's List of Tokens / Keywords

    ahoeben, I'm a bit late, but thank you for the link to that list.  As a software developer, I prefer to use variables where I can (like in the printer's GCode).  (And since I mangle a lot of gcode by hand, it's easier to keep one version with things like M109 S{material_print_temp_wait} then recode it for every different filament.)

  • 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.8 Stable released 🎉
        In the Cura 5.8 stable release, everyone can now tune their Z seams to look better than ever. Method series users get access to new material profiles, and the base Method model now has a printer profile, meaning the whole Method series is now supported in Cura!
        • 5 replies
      • 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
    ×
    ×
    • Create New...