prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.73k stars 1.93k forks source link

Simple "find and replace" option as post-processing #9114

Closed Tupson444 closed 2 years ago

Tupson444 commented 2 years ago

Sometimes I want to alter the Start G-code (or something else) for one print only. Of course, I can change it in the Printer Settings or Filament Settings, but I would like to save it within the Print Settings.

Describe the solution you'd like A good solution would be to use post-processing to find and replace text, right under Print Settings > Output options, without using external scripts. As I can see, that is possible in Simplify3D (for example {REPLACE "old text" "new text"}), but it doesn't work in PrusaSlicer (error: The configured post-processing script does not exist). Am I just missing something?

Describe how it would work I can place a comment in Start G-code, for example ";find-replace:start". Then use find and replace as post-processing to replace ";find-replace:start" with whatever G-code needed and save Print Settings (without the need to save separate Printer Settings preset).

Describe alternatives you've considered For now I can export the G-code and use any text editor to manually find and replace text.

Or I can use filament-specific start G-code and save Filament Settings (in which case I need to save separate Filament Settings even though all other filament-related settings are the same).

bubnikv commented 2 years ago

PrusaSlicer supports find and replace using regular expressions since PrusaSlicer 2.4.1 I believe. The feature is certainly supported by the currently released PrusaSlicer 2.5.0.

út 1. 11. 2022 v 22:38 odesílatel Tupson444 @.***> napsal:

Sometimes I want to alter the Start G-code (or something else) for one print only. Of course, I can change it in the Printer Settings or Filament Settings, but I would like to save it within the Print Settings.

Describe the solution you'd like A good solution would be to use post-processing to find and replace text, right under Print Settings > Output options, without using external scripts. As I can see, that is possible in Simplify3D (for example {REPLACE "old text" "new text"}), but it doesn't work in PrusaSlicer (error: The configured post-processing script does not exist). Am I just missing something?

Describe how it would work I can place a comment in Start G-code, for example ";find-replace:start". Then use find and replace as post-processing to replace ";find-replace:start" with whatever G-code needed and save Print Settings (without the need to save separate Printer Settings preset).

Describe alternatives you've considered For now I can export the G-code and use any text editor to manually find and replace text.

Or I can use filament-specific start G-code and save Filament Settings (in which case I need to save separate Filament Settings even though all other filament-related settings are the same).

— Reply to this email directly, view it on GitHub https://github.com/prusa3d/PrusaSlicer/issues/9114, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMPSIZOMJWUGX4KPQ7X57LWGGEWDANCNFSM6AAAAAARUO4ZSA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Tupson444 commented 2 years ago

Oh sorry, I didn't find it before, I tried typing under "post-processing". Now I see it's in "G-code substitutions". My bad, I'm closing the issue.