diff --git a/CHANGELOG.md b/CHANGELOG.md index 2042e3c0..584f164c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Problems with filtered/modified PCBs - Problems with zones on multiple layers (#226) - Problems with `hide_excluded: true` and components not in the SCH (#258) + - Text vars generated in the same run didn't show up (#280) - SCH Variants on KiCad 6: Problems with missing values in the title block. - Report: Converted file wasn't stored at `dir` (#238) - Datasheet download: Time-outs on some servers expecting modern browsers (#240) diff --git a/kibot/pre_set_text_variables.py b/kibot/pre_set_text_variables.py index 214e0a05..571d2d97 100644 --- a/kibot/pre_set_text_variables.py +++ b/kibot/pre_set_text_variables.py @@ -8,11 +8,12 @@ Dependencies: - from: Git role: Find commit hash and/or date """ -import os -import sys import json +import os +import pcbnew import re from subprocess import run, PIPE +import sys from .error import KiPlotConfigurationError from .misc import FAILED_EXECUTE, W_EMPTREP from .optionable import Optionable @@ -147,5 +148,9 @@ class Set_Text_Variables(BasePreFlight): # noqa: F821 GS.make_bkp(pro_name) with open(pro_name, 'wt') as f: f.write(json.dumps(data, sort_keys=True, indent=2)) + # Force a project reload + sm = pcbnew.GetSettingsManager() + sm.UnloadProject(GS.board.GetProject(), False) + assert sm.LoadProject(pro_name) # Force the PCB reload (will reload the project file) GS.board = None