Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom G-code for color change does not process macro #5782

Closed
fe60 opened this issue Jan 15, 2021 · 5 comments
Closed

Custom G-code for color change does not process macro #5782

fe60 opened this issue Jan 15, 2021 · 5 comments

Comments

@fe60
Copy link

fe60 commented Jan 15, 2021

Version

Version: 2.3.0+win64
Build: PrusaSlicer-2.3.0+win64-202101111315

Behavior

I want to increase the minimum distance between nozzle and heat bed when filament has to be changed during a print [1]. Therefor I have added a macro to the default G-code M600 (Printer Settings => Custom G-code => Color Change G-code).
M600 {if layer_height<70}Z70{endif}

For layers below 70mm I expect to see the following in the .gcode file.
M600 Z70 [2]

But instead of getting the Z-parameter, I see this in the .gcode file:
M600 {if layer_height<70}Z70{endif}

It seems the macro is not processed. Instead the content is transferred to the .gcode file as is.
The documentation about macros doesn't mention restrictions regarding the custom code sections the macros can be applied to [3].

Can you please get the macros working for the "Color Change G-code"?

Is this a new feature request?
No

[1] https://github.com/prusa3d/Prusa-Firmware/blob/MK3_3.9.3/Firmware/Marlin_main.cpp#L3169
[2] https://marlinfw.org/docs/gcode/M600.html
[3] https://help.prusa3d.com/en/article/macros_1775

@stringlapse
Copy link

Same issue here on the same version and build. I have {if layer_z < 30}G1 F300 Z30{endif} in my custom color change gcode and it's going directly to the gcode file without being processed.

@delaosa
Copy link

delaosa commented Jan 31, 2021

Same with version 2.3.0 in Linux, Pause g-code is also ignoring variables.

@mvadu
Copy link

mvadu commented Feb 28, 2021

Not only macros, it does not do even simple variable expansion. `M104 S[temperature] comes out as is in the final gcode file.

bubnikv added a commit that referenced this issue Mar 1, 2021
Added macro processing of color_change_gcode, pause_print_gcode
and template_custom_gcode custom G-codes when emitting them into
the output G-code.
@bubnikv
Copy link
Collaborator

bubnikv commented Mar 1, 2021

Implemented with 224f3e5

@SimonSolar2C
Copy link

This appears to be broken again in the Arachne version, 2.5.59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants