Suggestion: Allow customization of default g-code file name within PrusaSlicer.
 
Notifications
Clear all

Suggestion: Allow customization of default g-code file name within PrusaSlicer.  

  RSS
Dik Harrison
(@dik-harrison)
Trusted Member
Suggestion: Allow customization of default g-code file name within PrusaSlicer.

I would like to be able to change the default g-code file name format to eliminate superfluous information and characters like the mm in the layer height.  Since I only have an MK3S I would like to eliminate that from the file name.  Being able to customize the file name to my liking would make it easier to see the desired information on the printer's screen, without having to wait for it to scroll.  For example:

Spool Holder Nut_0.3_PLA_1:59

instead of:

Spool Holder Nut_0.3mm_PLA_MK3S_1h59m

Napsal : 16/02/2020 6:47 pm
bobstro
(@bobstro)
Illustrious Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

Check Print Settings->Output options->Output file->Output filename format. You can insert just about any configuration parameter, or trim them as desired.

My notes and disclaimers on 3D printing

and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan

Napsal : 16/02/2020 7:04 pm
Ty se líbí
Dik Harrison
(@dik-harrison)
Trusted Member
Topic starter answered:
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

Thanks, had't seen that...

Napsal : 16/02/2020 7:18 pm
RickSeiden
(@rickseiden)
Trusted Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

Hello,

This means that I not only have to change it for each profile, but that when Prusa updates their profiles, I have to update the default profiles and overwrite the ones I had previously customized.  It would be easier if there was one place in the slicer that I could go to set the output format universally.

Thanks

Rick

Napsal : 18/05/2020 10:31 am
Neophyl
(@neophyl)
Illustrious Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

@rick-s7

Seeing as you can not edit the default ones anyway you don't have to worry about a change Prusa makes resetting them.  If you have saved your own with the changes then you don't have to worry about it.

Napsal : 18/05/2020 10:59 am
RickSeiden
(@rickseiden)
Trusted Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.
Posted by: @neophyl

@rick-s7

Seeing as you can not edit the default ones anyway you don't have to worry about a change Prusa makes resetting them.  If you have saved your own with the changes then you don't have to worry about it.

You can change the default ones any time you want.  You just can't save your changes over the default profiles--you have to save it as a copy.  And that's the problem.

Say I made a copy of the 0.3mm Draft profile to have the default filename just the way I like it.  And I use the 0.2mm Speed one, too, so I make a copy of that, too.  Then Prusa updates the default versions of those profiles.  Now I have to go into the newly updated profiles, make the same changes I made last time, and save over my copy of the profiles.  And I have to do this every time Prusa updates the profiles.

But if there was one single place in the slicer I could go to update the default filename, I wouldn't have to worry about how often Prusa updates the default profiles.

Napsal : 18/05/2020 11:26 am
Neophyl
(@neophyl)
Illustrious Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

@rick-s7

So your issue is that you would like the changes prusa makes to its default profiles to be passed to your copies , except for the output naming option ?

If that's what you want then yes, the easiest change would be to set the default name somewhere you can configure.  You could always go and request the change at the correct place which is https://github.com/prusa3d/PrusaSlicer/issues .  It might actually get added - at some point.  Given that there are already 1376 open issues at the time of writing this.

If it were myself then I would just edit the PrusaResearch.ini file and change the [print:*common*] profile in there.  It has the basic output line that all the built in profiles use "output_filename_format = {input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode" <- Edit that line to whatever you want and all the built in Prusa Print profiles will use whatever to replace it with

Yes you would have to edit the file after each update from Prusa but you could probably script the change, look for the "output_filename_format = *" section and replace that entire line with your own line.  That would be the easiest way to update all the built in ones and any that also reference the common block (the profiles work by by using a nested hierarchy with anything in later levels over riding the values from earlier ones). 

Napsal : 18/05/2020 11:52 am
eponymous, a se líbí
RickSeiden
(@rickseiden)
Trusted Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.
Posted by: @neophyl

@rick-s7

So your issue is that you would like the changes prusa makes to its default profiles to be passed to your copies , except for the output naming option ?

No.  I'd like there to be one place in the slicer I can go that sets the default file naming convention any gcode export.

If that's what you want then yes, the easiest change would be to set the default name somewhere you can configure.  You could always go and request the change at the correct place which is https://github.com/prusa3d/PrusaSlicer/issues .  It might actually get added - at some point.  Given that there are already 1376 open issues at the time of writing this.

1376 other open issues means that this one is quite insignificant, I guess. My desire for this feature isn't strong enough to either add it to that pile, or to do what you had suggested with the scripting.  I'll just live with editing the filename.

Thanks

 

Rick

Napsal : 18/05/2020 12:16 pm
Dik Harrison
(@dik-harrison)
Trusted Member
Topic starter answered:
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

I have the file name as I want it, but still have to deal with the time as xhxm instead of h:mm, but that is not much of a problem.  I won't put in a change request as the developers have enough on their plates.

Napsal : 18/05/2020 12:20 pm
Ersin Girgin
(@ersin-girgin)
Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

Any way to add used filament weight info to name?

I tried to add _{used_filament} but just get the length info but couldn't find a way to change it to weight.

Napsal : 22/08/2023 7:16 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

Yes you can add weight (as long as the weight is shown when you slice it).  My current naming string is
{input_filename_base}_{layer_height}mm_{filament_type[0]}_{temperature[0]}_{print_time}_{int(total_weight)+1}g.gcode  

That adds the total weight used trimmed to an integer and adds 1g as I like to round up to the next gram.  So 11.9g would be 12g or 11.1 would also be 12.  In the rare cases where the weight is a total number like 11g then adding 1 doesnt make much difference and over is better than under.  You can use various combinations to get as many of few decimal places as you want too.

The list of placeholders is located here https://help.prusa3d.com/article/list-of-placeholders_205643   

Passing on info I was given - use "...{int(total_weight)}g..."For more decimals use "...{int((total_weight*10.0))/(10.0)}g..." or replace the "10.0" with any order of magnitude you like. 
And yes, the amount of brackets look redundant, but they are important. Tested with Slicer 2.2.0  and works just the same in 2.6.0

Napsal : 22/08/2023 9:14 pm
GhostlyFabricator
(@ghostlyfabricator)
Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

How do you change the magnitude to include two decimal places?

Napsal : 03/01/2024 4:21 am
Neophyl
(@neophyl)
Illustrious Member
RE: Suggestion: Allow customization of default g-code file name within PrusaSlicer.

It quite literally in the instructions from the previous post. Replace the "10.0" with any order of magnitude you want.

So {int((total_weight*100.0))/(100.0)}g would give 2 decimal places.  {int((total_weight*1000.0))/(1000.0)}g would give 3 etc etc

Although why you would need so many decimal places, unless you are weighing everything on microgram scales.

Napsal : 03/01/2024 10:09 am
Diem
 Diem
(@diem)
Illustrious Member

...and be aware that 'decimal' points may be interpreted as seperators by some filing systems and mess up your directory structures.

Cheerio,

Napsal : 03/01/2024 8:43 pm
Share: