Change default output filename to imported object
 
Notifications
Clear all

[Solved] Change default output filename to imported object  

  RSS
helitom
(@helitom)
Member
Change default output filename to imported object

I am running: PrusaSlicer Version 2.8.0+win64

I have several projects saved under the type of filament that I use (wood, Hatchbox etc.) Each has a different set of settings for print parameters.

I open them, delete the object in them, add a new object, slice and export gcode.

I would like the default output file name to default to the base name of the object I imported. For example if I add a file called east_wall.stl, I would the the default output to be east_wall.gcode. I have looked at the output_filename_format under the Output options of the Print Settings but can't find the right parameter name.

Is there a way to do this?

Thanks,

Tom

Best Answer by Neophyl:

Thanks for the extra explanation.  Unfortunately I can't see it being possible to do what you want currently with your existing workflow. 
I myself save 'template' projects to load parts into and slice but I usually always save them as a specific project name for each part.  Projects can actually be smaller than the original stl files sometimes and having a proper backup copy of everything including positions, modifiers, painting etc is always useful.

Instead of loading in a project called 'Wood' you could alter your process as follows.

Option A, least favourable option
save your Print , filament and printer settings as actual proper profiles.  Then open a new project, load in a part, select the profiles for Wood from the dropdowns, slice and export.  That way your gcode has the name you want as its not a saved project but has the settings loaded from the profiles.  You can then load in different parts and slice/export getting updated gcode names each time.

Option B - easier way to do it using your existing saved 'Wood' project
Open a new project and load your part.  Then use File>Import>Import Config from Project and select your saved project 'Wood'.  Shortcut is Ctrl+Alt+L.  That way the settings from the project get loaded into the non saved project and you can slice and export the gcode.  The name will be your stl part name.  You can load a different part and slice and as its not saved again the export name will be the top most part.

Option C
Personally I would just use Cntl+Alt+S to save the project each time.  So new project, Load your part, use the import config from project shortcut from option B.  Then save the project using the save shortcut.  The default name of the project will be the name of the part and that way you get a full backup of everything.  When sliced as the project name is your part the output gcode is also the correct name.

 

 

Posted : 10/07/2024 7:52 pm
mvikman
(@mvikman)
Trusted Member
RE: Change default output filename to imported object

Wouldn't it just be {input_filename_base}.gcode ?

Posted : 11/07/2024 11:04 am
helitom
(@helitom)
Member
Topic starter answered:
RE: Change default output filename to imported object

@mvikman,

input_filename_base is the name of the project, not the object that was most recently imported. In the my example above, input_filename_base is "wood" and not the object east_wall.

 

Posted : 11/07/2024 1:55 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Change default output filename to imported object

Input_filename_base is taken from the first object in the tree list.  At least when its a new project that hasn't been saved as a specific project name.  As soon as you save a project then it will use the project name.

Posted : 11/07/2024 5:04 pm
helitom
(@helitom)
Member
Topic starter answered:
RE: Change default output filename to imported object

@neophyl

I understand, let me try to explain in more detail.

I have an existing project with all the settings for wood PLA called "wood". What I typically do is:

  1. open PrusaSlicer
  2. select Menu->File->Recent Projects->wood to open the wood project
  3. delete the object that it has from the last save (months ago)
  4. add a new object, in this case east_wall.stl
  5. slice the object
  6. save the resulting gcode as east_wall.gcode. But the default name for the file is wood.gcode so I have to erase that and replace it with east_wall
  7. close PrusaSlicer and not save the changes

I realize this is trivial but just wondered if there was a way to have the save on the gcode default to the name of the last stl file that was added.

Thanks,

Tom

Posted : 11/07/2024 7:05 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Change default output filename to imported object

Thanks for the extra explanation.  Unfortunately I can't see it being possible to do what you want currently with your existing workflow. 
I myself save 'template' projects to load parts into and slice but I usually always save them as a specific project name for each part.  Projects can actually be smaller than the original stl files sometimes and having a proper backup copy of everything including positions, modifiers, painting etc is always useful.

Instead of loading in a project called 'Wood' you could alter your process as follows.

Option A, least favourable option
save your Print , filament and printer settings as actual proper profiles.  Then open a new project, load in a part, select the profiles for Wood from the dropdowns, slice and export.  That way your gcode has the name you want as its not a saved project but has the settings loaded from the profiles.  You can then load in different parts and slice/export getting updated gcode names each time.

Option B - easier way to do it using your existing saved 'Wood' project
Open a new project and load your part.  Then use File>Import>Import Config from Project and select your saved project 'Wood'.  Shortcut is Ctrl+Alt+L.  That way the settings from the project get loaded into the non saved project and you can slice and export the gcode.  The name will be your stl part name.  You can load a different part and slice and as its not saved again the export name will be the top most part.

Option C
Personally I would just use Cntl+Alt+S to save the project each time.  So new project, Load your part, use the import config from project shortcut from option B.  Then save the project using the save shortcut.  The default name of the project will be the name of the part and that way you get a full backup of everything.  When sliced as the project name is your part the output gcode is also the correct name.

 

 

Posted : 11/07/2024 9:01 pm
ssmith liked
miller chaney
(@miller-chaney)
Member
RE: Change default output filename to imported object

You can use the %n Placeholder. The %n placeholder in PrusaSlicer's output file name format is specifically designed to represent the name of the loaded model.

uno online
Posted : 22/08/2024 3:55 am
Share: