Jump to content
Ultimaker Community of 3D Printing Experts
inventabuild

Cura's List of Tokens / Keywords

Recommended Posts

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 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

;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}

Share this post


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 Ultimaker Cura 3.6 | Beta
      Ultimaker Cura 3.6 | Beta is available. It comes with new features, bug fixes, and UX improvements. We would really like to have your feedback on it to make our stable release as good as it can be. As always, you can download the beta for free from our website, for Windows, MacOS, and Linux.
        • Like
      • 95 replies
    • Print Core CC | Red for Ruby
      Q: For some users, abrasive materials may be a new subject matter. Can you explain what it is that makes a material abrasive when you are not sure which print core to use?
      A: Materials which are hard in a solid piece (like metals, ceramics and carbon fibers) will generally also wear down the nozzle. In general one should assume...
        • Like
      • 30 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!