YakAttack_Joey
Posts: 1
Joined: Thu Apr 01, 2021 9:27 am

File Naming

I would like the option to add the filament weight to the gcode file name. I know can manually change it to whatever I want it to be but, it would be nice if it was added to the file name automatically. I'm imagining there's an box to click in the settings that enables/disables adding the filament weight to the file name automatically. This could also be done for other parameters such as the build time, filament type, etc.

It may not seem that useful to most folks but, I often find that between the time I slice and print, I'll forget how much filament I need. I don't always print directly after slicing and I sometimes slice multiple files at once so it's easy to forget.
parallyze
Posts: 352
Joined: Fri Jun 05, 2015 4:18 am

Re: File Naming

YakAttack_Joey wrote: Thu Apr 01, 2021 9:39 am I know can manually change it to whatever I want it to be but, it would be nice if it was added to the file name automatically.
Using the post processing/additional terminal commands you could do something like this:
(in case you don't want to wait for an update to include file naming features)

At the end of each gcode file generated by S3D there's this comment:

Code: Select all

;   Plastic weight: 69.13 g (0.15 lb)
If we ignore rounding and simply "cut" between the ":" and the "." we can get this information and add it to the filename using a batch/cmd file:

Code: Select all

@echo off

echo Input file: "%~1%"
echo/

for /f "tokens=4 delims=;:g. " %%x in ('findstr /i "weight: " "%~1%"') do (
  echo "Plastic weight is: %%xg"
  set textToAdd=_%%xg
)

echo/
echo Text to add to filename: %textToAdd%
echo/
ren "%~1" "%~n1%textToAdd%%~x1"
Here's what it will do/output:
ren1.JPG
"test1.gcode" is renamed to "test1_69g.gcode".

You can include this as mentioned inside S3D so it will run automatically for each gcode file you export using that profile:
ren2.JPG
It's a modified version of this approach: viewtopic.php?f=23&t=6501&p=57235#p57240

Return to “Feature Requests”