Dict object has no attribute BED error

Basic Information:

Printer Model: voron v2.4
MCU / Printerboard: spider v1.1
Host / SBC RPI
klippy.log Did not get that far
config-20240804-121541.zip (6.1 KB)
Suzuki odo reset.gcode (1.1 MB)

PRINT_START

Describe your issue:

…I changed laptop (ubuntu 24.04LTS) and reinstalled prusaslicer (2.7.2).
Now I am still using the same CFG except that I changed a few minor things to do with the colour change as directed by Sineos. Mainly retract distance and absolute positioning in the M600 Macro, which this problem is not related to.

But for some reason I now get an error : Error evaluating ‘gcode_macro PRINT_START:gcode’: jinja2.exceptions.UndefinedError: ‘dict object’ has no attribute ‘BED’

I have looked everywhere and I cannot understand this error.
Most likely it is something stupid I did or I am overseeing, but for the life of me I cannot find it.
I included the CFG and the Gcode for the file and how I called PRINT_START.
I hope this is showing whoever knows about these things what is going on.

From the sliced gcode:
grafik

Macro:

gcode:
    # Parameters
    {% set bedtemp = params.BED|int %}
    {% set hotendtemp = params.HOTEND|int %}
    {% set chambertemp = params.CHAMBER|default(0)|int %}

There are multiple issues:

  • You are calling the macro wrongly in the slicer, e.g. wrong parameters (BED vs. BED_TEMP)
  • There are line breaks
  • You assume the temps to be integers (not sure if it is true for Prusa, but generally a dangerous assumption)

See Using START_PRINT and END_PRINT Macros for a breakdown.

I have reviewed and changed my wrong codes to what you pointed out and it now starts without the error message. It is now on layer 4 so I am fully expecting this solved my problem, many thanks.
Strange things remain in my mind;

  1. From where did these BED_TEMP and EXTRUDER_TEMP come from in the gcode, if I forgot to put them in my custom PRINT_START section? It can only have been Prusa who put it there as I did not put anything!
  2. the INT opposed to FLOAT was always in this CFG, and always worked. Do you have a good resource somewhere that will help me understand the differences and consequences please?

Prusa and its derivates know two different places for such information / code: Global machine settings and filament settings.
I’d not be aware that they add something in the form as shown in your sliced gcode on their own account. Wouldn’t make any sense, either.

Nothing really bad will happen. If you pass, e.g., 60.5 then it will be cast to integer 60. In other cases, the wrong type can lead to strange errors.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.