Skip to content

set_origin changes not reflected in the UI until KiCad reloaded

Summary

Setting the grid origin with board.set_origin appears to work internally, but the change isn't visible in the GUI, until the project is saved and reloaded at which point the new grid origin appears.

Reproduction steps

Given the following code

board = ki.get_board()

x, y = (17750000, 5000000)
print(board.get_origin(BoardOriginType.BOT_GRID))
board.set_origin(
    origin_type=BoardOriginType.BOT_GRID, origin=Vector2.from_xy(x, y)
)
print(board.get_origin(BoardOriginType.BOT_GRID))

The output will resemble

Vector2(19250000, 9750000)
Vector2(17750000, 5000000)

No change in the UI will be seen. Save and reload the project and the new origin appears.

Version Info

  • Python version: 3.13.3
  • kicad-python version: 0.4.0.dev0 (commit 1b0423dd)

KiCad full version info:

Application: kicad-cli arm64 on arm64

Version: 9.0.2-rc1, release build

Libraries:
        wxWidgets 3.2.6
        FreeType 2.13.3
        HarfBuzz 10.2.0
        FontConfig 2.15.0
        libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.58.0

Platform: macOS Sonoma Version 14.3.1 (Build 23D60), 64 bit, Little endian, wxBase

Build Info:
        Date: Apr 24 2025 16:23:37
        wxWidgets: 3.2.6 (wchar_t,wx containers)
        Boost: 1.87.0
        OCC: 7.8.1
        Curl: 8.7.1
        ngspice: 44.2
        Compiler: Clang 16.0.0 with C++ ABI 1002
        KICAD_IPC_API=ON
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information