IcanCwhatUsay wrote: ↑Thu Oct 15, 2020 11:19 pm
So using this code,
Code: Select all
cmd /c ren [output_filepath] [output_filename]_2.gcode
Nothing happens when I'm saving as a gcode file. it's just StlFileName.gcode. I can tell the slicer is at least recognizing that there's text in this field because it shows up in the .gcode file properties section, but that's about it.
Is it possible there's some spaces in your path and/or filename? Then quotation marks should help:
Code: Select all
cmd /c ren "[output_filepath]" "[output_filename]_2.gcode"
Tested this with different combinations (spaces within path, filename and both), seems to work.
My only goal really is to call out files based on what machine or profile I used to slice them and I would prefer it to be a prefix anyways since I can then sort by if it's a prefix. I really feel like there is a straight forward, automated way of doing this. I just can't seem to find it.
Scripts are within a profile so instead of "_2" you could add "_machinename" to use this with different profiles.
You could add checking for different file extensions and other things. But I'd suggest doing so inside a batch/cmd file and just passing
the filename from S3D to that one. Using for-loops inside the script window is tricky because of how the "%" and quotation marks get handled...
Edit:
This is what the above line looks like in the final gcode file:
Code: Select all
; postProcessing,cmd /c ren "[output_filepath]" "[output_filename]_2.gcode"
exactly like in the scripts window.
If this doesn't work, try something very simple to see if cmd is doing anything at all:
This should open up windows calculator each time you save a file.
By adding "echo" and a redirection like this (the space between " and > is important!):
Code: Select all
cmd /c echo ren "[output_filepath]" "[output_filename]_2.gcode" >c:\test\output.txt
Instead of executing the ren(ame) command it will echo the whole command to a text file. This
should now read something like this:
Code: Select all
ren "C:\Test\My Test Export.gcode" "My Test Export_2.gcode"
I've saved the file to "C:\Test\My Test Export.gcode" and it'd be renamend to "My Test Export_2.gcode".