You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote the script to temperature calibration tower that adds M104 command in the right places. To made it parametric I needed some variables, where i can store valiues. Unfortunately there's no free variables so I had to use some of already present and that not change gcode.
In my case i used filament cost, density and soluble to make it works.
It would be very helpful to be able to define and use variables inside custom gcode section. This code could be more clear and editable then and also will allow others to create other macros.
Enough for now could be some new hardcoded variables. Such like I have already used, but not used nowhere else. Is this a new feature request?
Yes
The text was updated successfully, but these errors were encountered:
Implements #4048#7196
Syntax:
(global|local) variable_name =
(scalar_expression|vector_variable|array_expr|initializer_list)
array_expr := array(repeat, value)
initializer_list := (value, value, value, ...)
The type of the newly created variable is defined by the type
of the right hand side intitializer.
Newly declared variable must not override an existing variable.
Variable may be assigned with global|local expression, but its type
must not be changed.
Newly the assignment operator also accepts the same right hand expressions
as the global|local variable definition.
Hi
I wrote the script to temperature calibration tower that adds M104 command in the right places. To made it parametric I needed some variables, where i can store valiues. Unfortunately there's no free variables so I had to use some of already present and that not change gcode.
In my case i used filament cost, density and soluble to make it works.
Here it is:
{if false} ;temp tower mode: set filament to soluble to enable, filament cost is height change for temp change, filament density is temp decrement {endif}
{if (filament_soluble[0] == true) && (layer_z >= filament_cost[0] * ((layer_z + z_offset - layer_z % filament_cost[0]) / filament_cost[0])) && (layer_z < (filament_cost[0] * ((layer_z + z_offset - layer_z % filament_cost[0]) / filament_cost[0]) + layer_height)) }M104 S{temperature[0] - (filament_density[0] * ((layer_z - layer_z % filament_cost[0]) / filament_cost[0])) } {endif}
It would be very helpful to be able to define and use variables inside custom gcode section. This code could be more clear and editable then and also will allow others to create other macros.
Enough for now could be some new hardcoded variables. Such like I have already used, but not used nowhere else.
Is this a new feature request?
Yes
The text was updated successfully, but these errors were encountered: