# CNX: apply Params # FreeCAD 26.3 RC1 does not pass spreadsheet edits on to the objects that read them # (a normal recompute only recomputes the sheet). Run this macro after editing Params: # it touches every object whose expressions read the sheet, then recomputes; anything # further down the chain (arrays, dimensions) follows normally. import FreeCAD as App doc = App.ActiveDocument sheet = doc.getObject("Params") if doc else None if sheet is None: App.Console.PrintError("CNX apply Params: the active document has no Params sheet\n") else: sheet.recompute() deps = [o for o in sheet.InList if o is not sheet] for o in deps: o.touch() n = doc.recompute() bad = [o.Label for o in doc.Objects if "Invalid" in o.State or "Error" in o.State] App.Console.PrintMessage(f"CNX apply Params: {len(deps)} objects read Params, {n} recomputed, errors: {bad[:10]}\n")