g-code substitutions does not work in PrusaSlicer 2.7.1
 
Notifications
Clear all

g-code substitutions does not work in PrusaSlicer 2.7.1  

  RSS
Scott Gartner
(@scott-gartner)
Eminent Member
g-code substitutions does not work in PrusaSlicer 2.7.1

In PrusaSlicer 2.7.1 I can't get the g-code substitutions to work at all.  I tried with and without regular expressions, I tried with and without comments.  I tried the following simplest possible substitution and, while I get the line output in the gcode, no actual replacements are made:

; gcode_substitutions = M73;xxxxxx;;

This was the setting I was hoping to make work:

; gcode_substitutions = "(M73\\s+P[0-9]+\\s+R[0-9]+)\\n";"${1} ;LAYER_CHANGE_TRIGGER_CAMERA\\nG91\\nG1 E-1 F1800\\nG1 Z0.3\\nG90\\nG1 X180 Y180 F3600\\nG91\\nG1 Z-0.3\\nG1 E1 F1800\\nG90\\n";r;"Move head to trigger keeping frame" 

Obviously, I turned off bgcode generation to validate that it wasn't working.  I thought that maybe the substitution only works with binary gcode, but when I try generating output with and without the (valid) substitution defined, the size of the bgcode file changes by only two bytes, which doesn't seem likely if the substitution was working. 

Posted : 07/01/2024 7:05 am
Scott Gartner
(@scott-gartner)
Eminent Member
Topic starter answered:
RE: g-code substitutions does not work in PrusaSlicer 2.7.1

I just wanted to update that the g-code that I put above doesn't actually work right.  I'm still unable to use the built-in substitutions, but using an external script I'm working on figuring out a useful thing to inject to make the printer do what I want.  But don't use the code I pasted, I'll update here when I have it right.

Posted : 07/01/2024 11:37 pm
Scott Gartner
(@scott-gartner)
Eminent Member
Topic starter answered:
RE: g-code substitutions does not work in PrusaSlicer 2.7.1

Well, that was weird, I tried to update the site with the working g-code that I created, but I got blocked saying that apparently it thought I was hacking the site?  Very strange.  I guess you'll have to wait to see the g-code until I post the complete script in my GitHub.

Posted : 11/01/2024 1:11 am
miroslav.h4
(@miroslav-h4)
Honorable Member
RE: g-code substitutions does not work in PrusaSlicer 2.7.1

You need to compress your code into a *.zip format and then paste it into the post. The forum will not accept any other format.

Posted : 11/01/2024 6:15 am
Scott Gartner
(@scott-gartner)
Eminent Member
Topic starter answered:
RE: g-code substitutions does not work in PrusaSlicer 2.7.1

I only pasted about five lines of g-code into the text of my reply.  I was not uploading a g-code file.  No idea why those 5 lines triggered something, but whatever.

Posted by: @miroslav-h4

You need to compress your code into a *.zip format and then paste it into the post. The forum will not accept any other format.

 

Posted : 18/01/2024 12:38 am
Share: