dw-0 / kiauh

Klipper Installation And Update Helper
GNU General Public License v3.0
3.09k stars 452 forks source link

I couldn't use the custom macros that i created with gcode_shell command in a gcode file #447

Closed Dalinaffeti closed 3 months ago

Dalinaffeti commented 3 months ago

Is your feature request related to a problem? Please describe

So i made a custom macro called SET_POWER, which sets the power for the laser. This macro calls a python script with the given parameter(POWER) for example POWER=75%. I manged to do all of that. Now what is missing me is to use it. I tought this will be called like this inside a gcode file: SET_POWER POWER=75.0. But i got nothing

Describe the solution you'd like

I want to konw how to use custom gcode macros that i created with gcode_shell_command

Describe alternatives you've considered

No response

Additional information

No response

Dalinaffeti commented 3 months ago

code for it: [gcode_shell_command set_power] command: sh /home/pi/printer_data/config/set_power.sh

[gcode_macro SET_POWER] gcode: {% set power = params.POWER %} { action_respond_info("%s" % (power)) } RUN_SHELL_COMMAND CMD=set_power PARAMS={power}