# Bed\_mesh\_profile load

**URL:** <https://klipper.discourse.group/t/bed-mesh-profile-load/19924>\
**Category:** General Discussion\
**Created:** [November 7, 2024, 5:24pm UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924 "2024-11-07T17:24:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jura](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jura](https://klipper.discourse.group/u/Jura)\
**Post date:** [November 7, 2024, 5:24pm UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/1 "2024-11-07T17:24:02Z")

</div>

How can I change the macro APPLY\_BUILD\_SHEET\_ADJUSTMENT to load a specific bed mesh profile?

I would like to BED\_MESH\_PROFILE LOAD of a specific sheet when apply build sheet adjustment.

```auto
[gcode_macro APPLY_BUILD_SHEET_ADJUSTMENT]
description: Applies the sheet offset adjustment for the installed build sheet, call from your PRINT_START macro
gcode:
    # get the offset from saved variables
    {% set svv = printer.save_variables.variables %}
    {% set sheet_key = (svv["build_sheet installed"] | string) %}
    {% set sheet = (svv[sheet_key] | default(None)) %}
    {% if sheet %}
        # log this to the console so if there is an issue with the print the user can see which sheet the printer thought it had installed
        {action_respond_info("Applying offset: %.3fmm for build sheet: %s" % (sheet.offset, sheet.name))}
        _BUILD_SHEETS__SET_GCODE_OFFSET Z_ADJUST={sheet.offset} MOVE=1
    {% else %}
        {action_respond_info("No build sheet installed, offset adjustment: 0.000mm") }
    {% endif %}

```

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [November 7, 2024, 5:37pm UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/2 "2024-11-07T17:37:31Z")

</div>

Hello @Jura !

Is there a reason you deleted the template?

Please read this:

> [@How-To Ask for Help](https://klipper.discourse.group/t/how-to-ask-for-help/6327/1):
>
> How-To Ask for Help General All contributors here help out in their spare time and because they want to give something back to the Klipper project. Be respectful and patient. If someone knows the answer to your question, they will answer it. Choose the right Category Questions / Issues should go into the General Discussion category most of the time. Filling the template is mandatory. The categories Config, Developers and Macros are used to post results of one’s work for the benefit of others T…

---

<div class="post-metadata">

**Author:** ![Jura](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jura](https://klipper.discourse.group/u/Jura)\
**Post date:** [November 7, 2024, 7:59pm UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/3 "2024-11-07T19:59:15Z")

</div>

Excuse mee.### Basic Information:  
 Printer Model: Custom COREXY  
 MCU / Printerboard: SKR mini E3 V3.0  
 Host / SBC CB1  
[klippy.zip](https://klipper.discourse.group/uploads/short-url/6SSjaW0pSe5kRErwhetllvg5M3Z.zip) (1.0 MB)  
 klippy.log

_Fill out above information and_ **_in all cases attach your_ `klippy.log` _file_** (use zip to compress it, if too big). _Pasting your_ `printer.cfg` _is **not** needed_  
_ **Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there** _

### Describe your issue:

Excuse me.

How can I change the macro APPLY\_BUILD\_SHEET\_ADJUSTMENT to load a specific bed mesh profile?  
I would like to BED\_MESH\_PROFILE LOAD of a specific sheet when apply build sheet adjustment.

[gcode\_macro APPLY\_BUILD\_SHEET\_ADJUSTMENT]  
description: Applies the sheet offset adjustment for the installed build sheet, call from your PRINT\_START macro  
gcode:

# get the offset from saved variables

{% set svv = printer.save\_variables.variables %}  
{% set sheet\_key = (svv[“build\_sheet installed”] | string) %}  
{% set sheet = (svv[sheet\_key] | default(None)) %}  
{% if sheet %}

# log this to the console so if there is an issue with the print the user can see which sheet the printer thought it had installed

{action\_respond\_info(“Applying offset: %.3fmm for build sheet: %s” % (sheet.offset, sheet.name))}  
\_BUILD\_SHEETS\_\_SET\_GCODE\_OFFSET Z\_ADJUST={sheet.offset} MOVE=1  
{% else %}  
{action\_respond\_info(“No build sheet installed, offset adjustment: 0.000mm”) }  
{% endif %}

---

<div class="post-metadata">

**Author:** ![Jura](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jura](https://klipper.discourse.group/u/Jura)\
**Post date:** [November 10, 2024, 8:03am UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/4 "2024-11-10T08:03:12Z")

</div>

Already solved.  
According to the selected sheet, the parameters of the sheet are loaded from Variables.cfg  
I solved it with the help of ChatGPT. It is a great helper.

My macro:

```auto
[gcode_macro LOAD_BED_PROFILE]
gcode:
    {% set svv = printer.save_variables.variables %}
    {% if svv["build_sheet installed"] == "build_sheet smooth_sheet_1" %}
        {action_respond_info("Build sheet is Smooth_sheet_1")}
        BED_MESH_PROFILE LOAD=Smooth_sheet_1
    {% elif svv["build_sheet installed"] == "build_sheet textured_sheet_1" %}
        {action_respond_info("Build sheet is Textured_sheet_1")}
        BED_MESH_PROFILE LOAD=Textured_sheet_1    
    {% else %}
        {action_respond_info("Non sheet")}
    {% endif %}

```

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [November 10, 2024, 8:23am UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/5 "2024-11-10T08:23:27Z")

</div>

Obviously you did not read the link entirely.

Code snippets are supposed to be formatted as `Preformatted Text`

![Format](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/6/643ab9def96b03089cfb0c194628129fcc96b3f8.png)

Please edit your posts accordingly. Without that format, the code is useless.

---

<div class="post-metadata">

**Author:** ![Jura](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@Jura](https://klipper.discourse.group/u/Jura)\
**Post date:** [November 10, 2024, 2:55pm UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/6 "2024-11-10T14:55:45Z")

</div>

Thank you 😀

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [December 11, 2024, 12:56am UTC](https://klipper.discourse.group/t/bed-mesh-profile-load/19924/7 "2024-12-11T00:56:12Z")

</div>

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