Total weight including spool placeholder name
 

Total weight including spool placeholder name  

  RSS
MonoTovarisj
(@monotovarisj)
Eminent Member

Any way to add the totalweight including the spool weight in the filename?
Weight of filament is {total_weight} and spool weight is {filament_spool_weight}

However I can't figure out the placeholder name for them added up. Is there a way I can add them up in the output filename format?

Posted : 11/06/2021 12:52 pm
Neophyl
(@neophyl)
Famed Member

I’d have to try the specifics (not at a pc at the moment) but something like _total weight ({total_weight}+{filament_spool_weight})g_ would I think add a into the output “_total weight xxxg” with the xxx being the result of adding the 2 together. 

Posted : 11/06/2021 2:49 pm
MonoTovarisj
(@monotovarisj)
Eminent Member

Got this:

Failed processing of the output_filename_format template.
Parsing error at line 1: Referencing a vector variable when scalar is expected
{input_filename_base}_({total_weight}+{filament_spool_weight})gr_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode
^

Posted : 11/06/2021 2:56 pm
MonoTovarisj
(@monotovarisj)
Eminent Member

Seems actually like filament_spool_weight can't even be used alone 🙁

Failed processing of the output_filename_format template.
Parsing error at line 1: Referencing a vector variable when scalar is expected
{input_filename_base}_{filament_spool_weight}gr_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode
^

Posted : 11/06/2021 2:59 pm
MonoTovarisj
(@monotovarisj)
Eminent Member

And this
{input_filename_base}_({total_weight}+201)gr_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}.gcode

results in this:
Filename_(15.0353+201)gr_0.2mm_PETG_MINI_2h15m.gcode

So doesn't seem like it can parse +

Posted : 11/06/2021 3:02 pm
Neophyl
(@neophyl)
Famed Member

My normal output format is "{input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}_{int(total_weight)+1}g.gcode"

So transposing that I can use

"{input_filename_base}_{layer_height}mm_{filament_type[0]}_{printer_model}_{print_time}_{(total_weight)+(filament_spool_weight[0])}g.gcode" 

That gives me a proper weight of the filament plus whatever is in the spool weight field of the filament.  As its filament you have to use [0] after it as its an array, even with only one filament selected there is more internally for when its being used bu a MMU with multiple filaments available. 

Personally I don't like the many decimal points but you can trim them off by using the int option like my normal one and you can do the following - 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.  You can adapt that to do the rounding however you want.

 

Posted : 11/06/2021 3:29 pm
Share:

Please Login or Register