User avatar
XoTT@6bI4
Posts: 27
Joined: Mon May 27, 2019 4:02 am

Re: Documentation for Script variables

I'm sorry. I took this post from some Russian site without translation. You can use a translator. Here is a complete list of variables that can be used in scripts.
  • Starting Script
    [spoiler="Старт"]Пользовательский G-код, который будет вставлен в самом начале. Все скорости должны вводиться в мм/мин.
    Можно использовать предустановленные переменные:
    - [extruder#_temperature] - темперетура сопла, где #є[0..5] (подставляются только определенные, c 4.1 - '-1');
    - [bed#_temperature] - темперетура стола, где #є[0..5] (подставляются только определенные, c 4.1 - '-1');
    - [fan_speed_percentage] - скорость вентилятора в процентах [0..100];
    - [fan_speed_pwm] - скорость вентилятора [0..255];
    - [progress] - процент печати (вроде всегда 0).

    С версии 4.1 добавили переменные:
    - [current_feature_type] - тип элемента, одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,gap_fill,
    solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield);
    - [current_layer] - текущий слой;
    - [current_layer_height] текущая высота слоя;
    - [current_position_$] - текущие координаты оси $, где $є[xyze];
    - [current_position_e#] - текущие координаты оси экструдера, где #є[0..5];
    - [next_position_$] - следующие координаты оси $, где $є[xyz];
    - [current_tool] - текущее сопло;
    - [first_tool] - не понятно;
    - [last_tool] - не понятно;
    - [prime_distance] - дистанция выдавливания после втягивания;
    - [prime_speed] - скорость выдавливания после втягивания, мм/мин;
    - [retract_distance] - дистанция втягивания;
    - [retract_speed] - скорость втягивания, мм/мин;
    - [retract_vertical_lift] - подъём сопла после втягивания;
    - [toolchange_prime_distance] - дистанция выдавливания после втягивания при смене сопла;
    - [toolchange_prime_speed] - скорость выдавливания после втягивания при смене сопла, мм/мин;
    - [toolchange_retract_distance] - дистанция втягивания при смене сопла;
    - [toolchange_retract_speed] - скорость втягивания при смене сопла, мм/мин;
    - [xy_travel_speed] - скорость перемещения по осям xy, мм/мин;
    - [z_travel_speed] - скорость перемещения по оси z, мм/мин;
    - [travel_speed] - скорость перемещения, мм/мин;
    - [chamber#_temperature] - не понятно, где #є[0..5];
    - [fan#_speed_percentage] - не понятно, где #є[0..5];
    - [fan#_speed_pwm] - не понятно, где #є[0..5];
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_filament_volume] - объем используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz];
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5].

    С версии 4.1 добавили операторы:
    - {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10, где
    xxx выражение (используется QJSEngine.toNumber(), интерпретатор кода JavaScript);
    - {IF "xxx"}zzz - при выполнения условия xxx выводится zzz, где
    xxx выражение (используется QJSEngine.toBool(), интерпретатор кода JavaScript).[/spoiler]
  • Ending Script
    [spoiler="Стоп"]Пользовательский G-код, который будет вставлен при завершении печати детали. Все скорости должны вводиться в мм/мин.
    Можно использовать предустановленные переменные:
    - [current_Z_position] - координаты Z;
    - [progress] - процент печати (вроде всегда 100).

    С версии 4.1 добавили переменные:
    - [extruder#_temperature] - темперетура сопла или -1, где #є[0..5];
    - [bed#_temperature] - темперетура стола или -1, где #є[0..5];
    - [chamber#_temperature] - не понятно или -1, где #є[0..5];
    - [fan_speed_percentage] - скорость вентилятора в процентах [0..100];
    - [fan_speed_pwm] - скорость вентилятора [0..255];
    - [fan#_speed_percentage] - не понятно, где #є[0..5];
    - [fan#_speed_pwm] - не понятно, где #є[0..5];
    - [current_feature_type] - тип элемента, одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,gap_fill,
    solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield);
    - [current_layer] - текущий слой;
    - [current_layer_height] текущая высота слоя;
    - [current_position_$] - текущие координаты оси $, где $є[xyze];
    - [current_position_e#] - текущие координаты оси экструдера, где #є[0..5];
    - [next_position_$] - следующие координаты оси $, где $є[xyz];
    - [current_tool] - текущее сопло;
    - [first_tool] - не понятно;
    - [last_tool] - не понятно;
    - [prime_distance] - дистанция выдавливания после втягивания;
    - [prime_speed] - скорость выдавливания после втягивания, мм/мин;
    - [retract_distance] - дистанция втягивания;
    - [retract_speed] - скорость втягивания, мм/мин;
    - [retract_vertical_lift] - подъём сопла после втягивания;
    - [toolchange_prime_distance] - дистанция выдавливания после втягивания при смене сопла;
    - [toolchange_prime_speed] - скорость выдавливания после втягивания при смене сопла, мм/мин;
    - [toolchange_retract_distance] - дистанция втягивания при смене сопла;
    - [toolchange_retract_speed] - скорость втягивания при смене сопла, мм/мин;
    - [xy_travel_speed] - скорость перемещения по осям xy, мм/мин;
    - [z_travel_speed] - скорость перемещения по оси z, мм/мин;
    - [travel_speed] - скорость перемещения, мм/мин;
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_filament_volume] - объем используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz];
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5].

    С версии 4.1 добавили операторы:
    - {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10, где
    xxx выражение (используется QJSEngine.toNumber(), интерпретатор кода JavaScript);
    - {IF "xxx"}zzz - при выполнения условия xxx выводится zzz, где
    xxx выражение (используется QJSEngine.toBool(), интерпретатор кода JavaScript).[/spoiler]
  • Layer Change Script
    [spoiler="Новый слой"]Пользовательский G-код, который будет вставлен при переходе на новый слой после команды втягивания. Все скорости должны вводиться в мм/мин.
    Можно использовать предустановленные переменные:
    - [next_position_$] - следующие координаты оси $, где $є[XYZ];
    - [previous_Z_position] - предыдущие координаты Z;
    - [current_Z_position] - следующие координаты Z;
    - [current_layer] - номер следующего слоя;
    - [progress] - процент печати.

    С версии 4.1 добавили переменные:
    - [extruder#_temperature] - темперетура сопла или -1, где #є[0..5];
    - [bed#_temperature] - темперетура стола или -1, где #є[0..5];
    - [chamber#_temperature] - не понятно или -1, где #є[0..5];
    - [fan_speed_percentage] - скорость вентилятора в процентах [0..100];
    - [fan_speed_pwm] - скорость вентилятора [0..255];
    - [fan#_speed_percentage] - не понятно, где #є[0..5];
    - [fan#_speed_pwm] - не понятно, где #є[0..5];
    - [current_feature_type] - тип элемента, одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,gap_fill,
    solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield);
    - [current_layer_height] текущая высота слоя;
    - [current_position_$] - текущие координаты оси $, где $є[xyze];
    - [current_position_e#] - текущие координаты оси экструдера, где #є[0..5];
    - [current_tool] - текущее сопло;
    - [first_tool] - не понятно;
    - [last_tool] - не понятно;
    - [prime_distance] - дистанция выдавливания после втягивания;
    - [prime_speed] - скорость выдавливания после втягивания, мм/мин;
    - [retract_distance] - дистанция втягивания;
    - [retract_speed] - скорость втягивания, мм/мин;
    - [retract_vertical_lift] - подъём сопла после втягивания;
    - [toolchange_prime_distance] - дистанция выдавливания после втягивания при смене сопла;
    - [toolchange_prime_speed] - скорость выдавливания после втягивания при смене сопла, мм/мин;
    - [toolchange_retract_distance] - дистанция втягивания при смене сопла;
    - [toolchange_retract_speed] - скорость втягивания при смене сопла, мм/мин;
    - [xy_travel_speed] - скорость перемещения по осям xy, мм/мин;
    - [z_travel_speed] - скорость перемещения по оси z, мм/мин;
    - [travel_speed] - скорость перемещения, мм/мин;
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_filament_volume] - объем используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz];
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5].

    С версии 4.1 добавили операторы:
    - {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10, где
    xxx выражение (используется QJSEngine.toNumber(), интерпретатор кода JavaScript);
    - {IF "xxx"}zzz - при выполнения условия xxx выводится zzz, где
    xxx выражение (используется QJSEngine.toBool(), интерпретатор кода JavaScript).[/spoiler]
  • Retraction Script
    [spoiler="Втягивание"]Пользовательский G-код, который будет вставлен перед каждым втягиванием. Все скорости должны вводиться в мм/мин.
    Поддерживаются операторы:
    {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10 (обновлено с версии 4.1);
    {IF xxxOPyyy}zzz - при выполнения условия выводится zzz (обновлено с версии 4.1), где
    - OP - операция, одна из (==,!=,<,<=,>,>=,=);
    - xxx может быть:
    - TOOL - № сопла, тогда yyy должно быть числом [0..5]
    - FEATURETYPE - тип элемента, тогда yyy должно быть одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,
    gap_fill,solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield)
    Можно использовать предустановленные переменные:
    - [retract_distance] - дистанция втягивания;
    - [prime_distance] - дистанция выдавливания после втягивания;
    - [retract_speed] - скорость втягивания;
    - [travel_speed] - скорость перемещения;
    - [current_position_$] - текущие координаты оси $, где $є[xyz];
    - [next_position_$] - следующие координаты оси $, где $є[xyz];
    - [previous_direction_$] - предыдущее смещение оси $, где $є[xyz] (с версии 4.1 удалено);
    - [next_direction_$] - следующее смещение оси $, где $є[xyz] (с версии 4.1 удалено);
    - [average_direction_$] - не понятно (с версии 4.1 удалено).

    С версии 4.1 добавили переменные:
    - [extruder#_temperature] - темперетура сопла или -1, где #є[0..5];
    - [bed#_temperature] - темперетура стола или -1, где #є[0..5];
    - [chamber#_temperature] - не понятно или -1, где #є[0..5];
    - [fan_speed_percentage] - скорость вентилятора в процентах [0..100];
    - [fan_speed_pwm] - скорость вентилятора [0..255];
    - [fan#_speed_percentage] - не понятно, где #є[0..5];
    - [fan#_speed_pwm] - не понятно, где #є[0..5];
    - [current_feature_type] - тип элемента, одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,gap_fill,
    solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield);
    - [current_layer] - текущий слой;
    - [current_layer_height] текущая высота слоя;
    - [current_position_e#] - текущие координаты оси экструдера, где #є[0..5];
    - [current_tool] - текущее сопло;
    - [first_tool] - не понятно;
    - [last_tool] - не понятно;
    - [prime_speed] - скорость выдавливания после втягивания, мм/мин;
    - [retract_vertical_lift] - подъём сопла после втягивания;
    - [toolchange_prime_distance] - дистанция выдавливания после втягивания при смене сопла;
    - [toolchange_prime_speed] - скорость выдавливания после втягивания при смене сопла, мм/мин;
    - [toolchange_retract_distance] - дистанция втягивания при смене сопла;
    - [toolchange_retract_speed] - скорость втягивания при смене сопла, мм/мин;
    - [xy_travel_speed] - скорость перемещения по осям xy, мм/мин;
    - [z_travel_speed] - скорость перемещения по оси z, мм/мин;
    - [progress] - процент печати;
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_filament_volume] - объем используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz];
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5].

    С версии 4.1 добавили операторы:
    - {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10, где
    xxx выражение (используется QJSEngine.toNumber(), интерпретатор кода JavaScript);
    - {IF "xxx"}zzz - при выполнения условия xxx выводится zzz, где
    xxx выражение (используется QJSEngine.toBool(), интерпретатор кода JavaScript).[/spoiler]
  • Tool Change Script
    [spoiler="Смена сопла"]Пользовательский G-код, который будет вставлен перед каждой командой смены сопла. Все скорости должны вводиться в мм/мин.
    Поддерживаются операторы:
    {IF xxxOPyyy}zzz - при выполнения условия выводится zzz (обновлено с версии 4.1), где
    - OP - операция, одна из (==,!=,<,<=,>,>=,=);
    - xxx может быть:
    - OLDTOOL - № предыдущего сопла, тогда yyy должно быть числом [0..5]
    - NEWTOOL - № нового сопла, тогда yyy должно быть числом [0..5]
    - FEATURETYPE - тип элемента, тогда yyy должно быть одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,
    gap_fill,solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield)
    Можно использовать предустановленные переменные:
    - [new_tool] - № нового сопла;
    - [old_tool] - № предыдущего сопла;
    - [travel_speed] - скорость перемещения;
    - [toolchange_retract_speed] - скорость втягивания при смене сопла;
    - [toolchange_retract_distance] - дистанция втягивания при смене сопла;
    - [toolchange_prime_distance] - дистанция выдавливания после втягивания при смене сопла;
    - [extruder#_temperature] - темперетура сопла, где #є[0..5];
    - [bed#_temperature] - темперетура стола, где #є[0..5];
    - [current_position_$] - текущие координаты оси $, где $є[XYZ];
    - [next_position_$] - следующие координаты оси $, где $є[XYZ];
    - [previous_direction_$] - предыдущее смещение оси $, где $є[XYZ] (с версии 4.1 удалено);
    - [next_direction_$] - следующее смещение оси $, где $є[XYZ] (с версии 4.1 удалено);
    - [average_direction_$] - не понятно (с версии 4.1 удалено).

    С версии 4.1 добавили переменные:
    - [chamber#_temperature] - не понятно или -1, где #є[0..5];
    - [fan_speed_percentage] - скорость вентилятора в процентах [0..100];
    - [fan_speed_pwm] - скорость вентилятора [0..255];
    - [fan#_speed_percentage] - не понятно, где #є[0..5];
    - [fan#_speed_pwm] - не понятно, где #є[0..5];
    - [current_feature_type] - тип элемента, одним из (travel,outer_perimeter,inner_perimeter,external_single_extrusion,internal_single_extrusion,gap_fill,
    solid_layer,infill,bridge,support,dense_support,raft,skirt,prime_pillar,ooze_shield);
    - [current_layer] - текущий слой;
    - [current_layer_height] текущая высота слоя;
    - [current_position_e#] - текущие координаты оси экструдера, где #є[0..5];
    - [current_tool] - текущее сопло;
    - [first_tool] - не понятно;
    - [first_tool_use] - не понятно;
    - [last_tool] - не понятно;
    - [prime_distance] - дистанция выдавливания после втягивания;
    - [prime_speed] - скорость выдавливания после втягивания, мм/мин;
    - [retract_distance] - дистанция втягивания;
    - [retract_speed] - скорость втягивания, мм/мин;
    - [retract_vertical_lift] - подъём сопла после втягивания;
    - [toolchange_prime_speed] - скорость выдавливания после втягивания при смене сопла, мм/мин;
    - [xy_travel_speed] - скорость перемещения по осям xy, мм/мин;
    - [z_travel_speed] - скорость перемещения по оси z, мм/мин;
    - [progress] - процент печати;
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_filament_volume] - объем используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz];
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5].

    С версии 4.1 добавили операторы:
    - {EVAL "xxx"} - у числа xxx уберает последние 0 и потом последнюю '.'. Например, от 10.000 останется 10, где
    xxx выражение (используется QJSEngine.toNumber(), интерпретатор кода JavaScript);
    - {IF "xxx"}zzz - при выполнения условия xxx выводится zzz, где
    xxx выражение (используется QJSEngine.toBool(), интерпретатор кода JavaScript).[/spoiler]
  • Post Processing
    [spoiler="Постобработка"]Запуск скриптов после создания файла G-кода. Например,
    "notepad.exe" "[output_filepath]"
    Можно использовать системные переменные (%programfiles%, %windir% и др.) и предустановленные:
    - [output_filename] - имя файла без расширения;
    - [output_filepath] - имя файла с директорией;
    - [output_dir] - директория файла;
    - [install_dir] - директория установки ПО;
    - [total_filament_used] - длинна используемого прутка;
    - [total_filament_weight] - вес используемого прутка;
    - [total_filament_cost] - стоимость используемого прутка;
    - [total_print_time_min] - время печати в минутах;
    - [total_print_time_sec] - время печати в секундах;
    - [total_layer_count] - количество слоёв;
    - [build_size_$] - размер детали по оси, где $є[xyz];
    - [extruder#_filament_used] - длинна используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_weight] - вес используемого прутка для экструдера, где #є[0..5];
    - [extruder#_filament_cost] - стоимость используемого прутка для экструдера, где #є[0..5].
    С версии 4.1 добавлены:
    - [total_filament_volume] - объем используемого прутка;
    - [extruder#_filament_volume] - объем используемого прутка для экструдера, где #є[0..5];
    - [build_min_$] - минимальная координата детали по оси, где $є[xyz];
    - [build_max_$] - максимальная координата детали по оси, где $є[xyz].

    Встроенные сценарии:
    - {PREPEND "G28\n"} - добавляет строку в начало;
    - {APPEND "G28\n"} - добавляет строку в конец;
    - {REPLACE "; layer" "M117 line ="} - заменяет одну строку на другую. В примере - вывод слоев на экран;
    - {DELETE "G28 X0 Y0\n"} - удаляет последовательность символов;
    - {STRIP ";"} - удаляет строку, если она с этого начинается;
    - {TOOL#REPLACE "xxx" "yyy"} - тоже, что и {REPLACE "xxx" "yyy"}, но для определенной головы, где #є[0..5] - номер головы,
    с 4.1 заменен на {REPLACEIFTOOL "#" "xxx" "yyy"}
    - {EXTENSION "gcode"} - устанавливает расширение файла.[/spoiler]
ahmadpi
Posts: 4
Joined: Mon Mar 06, 2017 4:32 am

Re: Documentation for Script variables

Using Google Translate:

Starting script
[spoiler = "Start"] A custom G code to be inserted at the very beginning. All speeds should be entered in mm / min.
You can use predefined variables:
- [extruder # _temperature] - nozzle temperature, where # є [0..5] (only certain ones are substituted, c 4.1 - '-1');
- [bed # _temperature] - table temperature, where # є [0..5] (only certain ones are substituted, c 4.1 - '-1');
- [fan_speed_percentage] - fan speed in percent [0..100];
- [fan_speed_pwm] - fan speed [0..255];
- [progress] - percentage of print (always like 0).

Since version 4.1, added variables:
- [current_feature_type] - element type, one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion, gap_fill,
solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield);
- [current_layer] - the current layer;
- [current_layer_height] current layer height;
- [current_position_ $] - the current coordinates of the $ axis, where $ є [xyze];
- [current_position_e #] - the current coordinates of the axis of the extruder, where # є [0..5];
- [next_position_ $] - the following coordinates of the $ axis, where $ є [xyz];
- [current_tool] - current nozzle;
- [first_tool] - not clear;
- [last_tool] - it is not clear;
- [prime_distance] - extrusion distance after retraction;
- [prime_speed] - extrusion speed after retraction, mm / min;
- [retract_distance] - retraction distance;
- [retract_speed] - retraction speed, mm / min;
- [retract_vertical_lift] - rising nozzle after retraction;
- [toolchange_prime_distance] - extrusion distance after retraction when changing the nozzle;
- [toolchange_prime_speed] - extrusion speed after retraction when changing the nozzle, mm / min;
- [toolchange_retract_distance] - retraction distance when changing the nozzle;
- [toolchange_retract_speed] - retraction speed when changing the nozzle, mm / min;
- [xy_travel_speed] - speed of movement along the xy axes, mm / min;
- [z_travel_speed] - speed of movement along the z axis, mm / min;
- [travel_speed] - travel speed, mm / min;
- [chamber # _temperature] - it is not clear where # є [0..5];
- [fan # _speed_percentage] - it is not clear where # є [0..5];
- [fan # _speed_pwm] - it is not clear where # є [0..5];
- [total_filament_used] - length of the used bar;
- [total_filament_weight] - weight of the bar used;
- [total_filament_cost] - the cost of the used bar;
- [total_filament_volume] - the volume of the used bar;
- [total_print_time_min] - print time in minutes;
- [total_print_time_sec] - print time in seconds;
- [total_layer_count] - the number of layers;
- [build_min_ $] - the minimum coordinate of the part along the axis, where $ є [xyz];
- [build_max_ $] - the maximum coordinate of the part along the axis, where $ є [xyz];
- [build_size_ $] - the size of the part along the axis, where $ є [xyz];
- [extruder # _filament_used] - the length of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_weight] - the weight of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_cost] - the cost of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_volume] - the volume of the rod used for the extruder, where # є [0..5].

Since version 4.1, added operators:
- {EVAL "xxx"} - the number xxx removes the last 0 and then the last '.'. For example, from 10,000 there will be 10, where
xxx expression (using QJSEngine.toNumber (), JavaScript code interpreter);
- {IF "xxx"} zzz - when condition xxx is fulfilled, zzz is displayed, where
xxx expression (used by QJSEngine.toBool (), JavaScript code interpreter). [/ spoiler]
Ending script
[spoiler = "Stop"] Custom G-code that will be inserted when printing the part. All speeds should be entered in mm / min.
You can use predefined variables:
- [current_Z_position] - Z coordinates;
- [progress] - percentage of print (always like 100).

Since version 4.1, added variables:
- [extruder # _temperature] - nozzle temperature or -1, where # є [0..5];
- [bed # _temperature] - table temperature or -1, where # є [0..5];
- [chamber # _temperature] - it is not clear or -1, where # є [0..5];
- [fan_speed_percentage] - fan speed in percent [0..100];
- [fan_speed_pwm] - fan speed [0..255];
- [fan # _speed_percentage] - it is not clear where # є [0..5];
- [fan # _speed_pwm] - it is not clear where # є [0..5];
- [current_feature_type] - element type, one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion, gap_fill,
solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield);
- [current_layer] - the current layer;
- [current_layer_height] current layer height;
- [current_position_ $] - the current coordinates of the $ axis, where $ є [xyze];
- [current_position_e #] - the current coordinates of the axis of the extruder, where # є [0..5];
- [next_position_ $] - the following coordinates of the $ axis, where $ є [xyz];
- [current_tool] - current nozzle;
- [first_tool] - not clear;
- [last_tool] - it is not clear;
- [prime_distance] - extrusion distance after retraction;
- [prime_speed] - extrusion speed after retraction, mm / min;
- [retract_distance] - retraction distance;
- [retract_speed] - retraction speed, mm / min;
- [retract_vertical_lift] - rising nozzle after retraction;
- [toolchange_prime_distance] - extrusion distance after retraction when changing the nozzle;
- [toolchange_prime_speed] - extrusion speed after retraction when changing the nozzle, mm / min;
- [toolchange_retract_distance] - retraction distance when changing the nozzle;
- [toolchange_retract_speed] - retraction speed when changing the nozzle, mm / min;
- [xy_travel_speed] - speed of movement along the xy axes, mm / min;
- [z_travel_speed] - speed of movement along the z axis, mm / min;
- [travel_speed] - travel speed, mm / min;
- [total_filament_used] - length of the used bar;
- [total_filament_weight] - weight of the bar used;
- [total_filament_cost] - the cost of the used bar;
- [total_filament_volume] - the volume of the used bar;
- [total_print_time_min] - print time in minutes;
- [total_print_time_sec] - print time in seconds;
- [total_layer_count] - the number of layers;
- [build_min_ $] - the minimum coordinate of the part along the axis, where $ є [xyz];
- [build_max_ $] - the maximum coordinate of the part along the axis, where $ є [xyz];
- [build_size_ $] - the size of the part along the axis, where $ є [xyz];
- [extruder # _filament_used] - the length of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_weight] - the weight of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_cost] - the cost of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_volume] - the volume of the rod used for the extruder, where # є [0..5].

Since version 4.1, added operators:
- {EVAL "xxx"} - the number xxx removes the last 0 and then the last '.'. For example, from 10,000 there will be 10, where
xxx expression (using QJSEngine.toNumber (), JavaScript code interpreter);
- {IF "xxx"} zzz - when condition xxx is fulfilled, zzz is displayed, where
xxx expression (used by QJSEngine.toBool (), JavaScript code interpreter). [/ spoiler]
Retraction script
[spoiler = "Retraction"] A custom G code to be inserted before each retraction. All speeds should be entered in mm / min.
The following operators are supported:
{EVAL "xxx"} - the number xxx removes the last 0 and then the last '.'. For example, from 10,000 there will be 10 (updated from version 4.1);
{IF xxxOPyyy} zzz - when the condition is met, zzz is displayed (updated from version 4.1), where
- OP - operation, one of (==,! =, <, <=,>,> =, =);
- xxx may be:
- TOOL - nozzle number, then yyy must be a number [0..5]
- FEATURETYPE - element type, then yyy must be one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion,
gap_fill, solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield)
You can use predefined variables:
- [retract_distance] - retraction distance;
- [prime_distance] - extrusion distance after retraction;
- [retract_speed] - retraction speed;
- [travel_speed] - speed of movement;
- [current_position_ $] - the current coordinates of the $ axis, where $ є [xyz];
- [next_position_ $] - the following coordinates of the $ axis, where $ є [xyz];
- [previous_direction_ $] - previous shift of the $ axis, where $ є [xyz] (removed from version 4.1);
- [next_direction_ $] - the next shift of the $ axis, where $ є [xyz] (removed from version 4.1);
- [average_direction_ $] - not clear (removed from version 4.1).

Since version 4.1, added variables:
- [extruder # _temperature] - nozzle temperature or -1, where # є [0..5];
- [bed # _temperature] - table temperature or -1, where # є [0..5];
- [chamber # _temperature] - it is not clear or -1, where # є [0..5];
- [fan_speed_percentage] - fan speed in percent [0..100];
- [fan_speed_pwm] - fan speed [0..255];
- [fan # _speed_percentage] - it is not clear where # є [0..5];
- [fan # _speed_pwm] - it is not clear where # є [0..5];
- [current_feature_type] - element type, one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion, gap_fill,
solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield);
- [current_layer] - the current layer;
- [current_layer_height] current layer height;
- [current_position_e #] - the current coordinates of the axis of the extruder, where # є [0..5];
- [current_tool] - current nozzle;
- [first_tool] - not clear;
- [last_tool] - it is not clear;
- [prime_speed] - extrusion speed after retraction, mm / min;
- [retract_vertical_lift] - rising nozzle after retraction;
- [toolchange_prime_distance] - extrusion distance after retraction when changing the nozzle;
- [toolchange_prime_speed] - extrusion speed after retraction when changing the nozzle, mm / min;
- [toolchange_retract_distance] - retraction distance when changing the nozzle;
- [toolchange_retract_speed] - retraction speed when changing the nozzle, mm / min;
- [xy_travel_speed] - speed of movement along the xy axes, mm / min;
- [z_travel_speed] - speed of movement along the z axis, mm / min;
- [progress] - percentage of print;
- [total_filament_used] - length of the used bar;
- [total_filament_weight] - weight of the bar used;
- [total_filament_cost] - the cost of the used bar;
- [total_filament_volume] - the volume of the used bar;
- [total_print_time_min] - print time in minutes;
- [total_print_time_sec] - print time in seconds;
- [total_layer_count] - the number of layers;
- [build_min_ $] - the minimum coordinate of the part along the axis, where $ є [xyz];
- [build_max_ $] - the maximum coordinate of the part along the axis, where $ є [xyz];
- [build_size_ $] - the size of the part along the axis, where $ є [xyz];
- [extruder # _filament_used] - the length of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_weight] - the weight of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_cost] - the cost of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_volume] - the volume of the rod used for the extruder, where # є [0..5].

Since version 4.1, added operators:
- {EVAL "xxx"} - the number xxx removes the last 0 and then the last '.'. For example, from 10,000 there will be 10, where
xxx expression (using QJSEngine.toNumber (), JavaScript code interpreter);
- {IF "xxx"} zzz - when condition xxx is fulfilled, zzz is displayed, where
xxx expression (used by QJSEngine.toBool (), JavaScript code interpreter). [/ spoiler]
Tool change script
[spoiler = "Change nozzle"] A custom G code to be inserted before each nozzle change command. All speeds should be entered in mm / min.
The following operators are supported:
{IF xxxOPyyy} zzz - when the condition is met, zzz is displayed (updated from version 4.1), where
- OP - operation, one of (==,! =, <, <=,>,> =, =);
- xxx may be:
- OLDTOOL - No. of the previous nozzle, then yyy must be a number [0..5]
- NEWTOOL - No. of the new nozzle, then yyy must be a number [0..5]
- FEATURETYPE - element type, then yyy must be one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion,
gap_fill, solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield)
You can use predefined variables:
- [new_tool] - No. of the new nozzle;
- [old_tool] - number of the previous nozzle;
- [travel_speed] - speed of movement;
- [toolchange_retract_speed] - retraction speed when changing the nozzle;
- [toolchange_retract_distance] - retraction distance when changing the nozzle;
- [toolchange_prime_distance] - extrusion distance after retraction when changing the nozzle;
- [extruder # _temperature] - nozzle temperature, where # є [0..5];
- [bed # _temperature] - temperature of the table, where # є [0..5];
- [current_position_ $] - the current coordinates of the $ axis, where $ є [XYZ];
- [next_position_ $] - the following coordinates of the $ axis, where $ є [XYZ];
- [previous_direction_ $] - previous shift of the $ axis, where $ є [XYZ] (removed from version 4.1);
- [next_direction_ $] - the next shift of the $ axis, where $ є [XYZ] (removed from version 4.1);
- [average_direction_ $] - not clear (removed from version 4.1).

Since version 4.1, added variables:
- [chamber # _temperature] - it is not clear or -1, where # є [0..5];
- [fan_speed_percentage] - fan speed in percent [0..100];
- [fan_speed_pwm] - fan speed [0..255];
- [fan # _speed_percentage] - it is not clear where # є [0..5];
- [fan # _speed_pwm] - it is not clear where # є [0..5];
- [current_feature_type] - element type, one of (travel, outer_perimeter, inner_perimeter, external_single_extrusion, internal_single_extrusion, gap_fill,
solid_layer, infill, bridge, support, dense_support, raft, skirt, prime_pillar, ooze_shield);
- [current_layer] - the current layer;
- [current_layer_height] current layer height;
- [current_position_e #] - the current coordinates of the axis of the extruder, where # є [0..5];
- [current_tool] - current nozzle;
- [first_tool] - not clear;
- [first_tool_use] - not clear;
- [last_tool] - it is not clear;
- [prime_distance] - extrusion distance after retraction;
- [prime_speed] - extrusion speed after retraction, mm / min;
- [retract_distance] - retraction distance;
- [retract_speed] - retraction speed, mm / min;
- [retract_vertical_lift] - rising nozzle after retraction;
- [toolchange_prime_speed] - extrusion speed after retraction when changing the nozzle, mm / min;
- [xy_travel_speed] - speed of movement along the xy axes, mm / min;
- [z_travel_speed] - speed of movement along the z axis, mm / min;
- [progress] - percentage of print;
- [total_filament_used] - length of the used bar;
- [total_filament_weight] - weight of the bar used;
- [total_filament_cost] - the cost of the used bar;
- [total_filament_volume] - the volume of the used bar;
- [total_print_time_min] - print time in minutes;
- [total_print_time_sec] - print time in seconds;
- [total_layer_count] - the number of layers;
- [build_min_ $] - the minimum coordinate of the part along the axis, where $ є [xyz];
- [build_max_ $] - the maximum coordinate of the part along the axis, where $ є [xyz];
- [build_size_ $] - the size of the part along the axis, where $ є [xyz];
- [extruder # _filament_used] - the length of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_weight] - the weight of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_cost] - the cost of the rod used for the extruder, where # є [0..5];
- [extruder # _filament_volume] - the volume of the rod used for the extruder, where # є [0..5].

Since version 4.1, added operators:
- {EVAL "xxx"} - the number xxx removes the last 0 and then the last '.'. For example, from 10,000 there will be 10, where
xxx expression (using QJSEngine.toNumber (), JavaScript code interpreter);
- {IF "xxx"} zzz - when condition xxx is fulfilled, zzz is displayed, where
xxx expression (used by QJSEngine.toBool (), JavaScript code interpreter). [/ spoiler]
Post processing
[spoiler = "Post-processing"] Running scripts after creating the G-code file. For example,
"notepad.exe" "[output_filepath]"
You can use system variables (% programfiles%,% windir%, etc.) and predefined:
- [output_filename] - file name without extension;
- [output_filepath] - the name of the file with the directory;
- [output_dir] - file directory;
- [install_dir] - dir

Return to “General Discussion and Tips”