From 2132c4e64cddcb8e00cc8d6ba46b015ff04a63c9 Mon Sep 17 00:00:00 2001 From: forbes Date: Sun, 8 Feb 2026 18:07:18 -0600 Subject: [PATCH] fix: use append instead of fragile insert chain in PartDesign menu (#57) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the chained insert operations in modifyMenuBar() with independent append operations. The old approach anchored on PartDesign_Boolean and chained each subsequent command off the previous insertion — a single missing anchor caused a cascade failure. The new approach uses append with PartDesign_Body as the parent locator. Each operation is independent, so a failure in one does not affect the others. --- ztools/InitGui.py | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/ztools/InitGui.py b/ztools/InitGui.py index 1a6662f..78e114e 100644 --- a/ztools/InitGui.py +++ b/ztools/InitGui.py @@ -365,26 +365,10 @@ class _ZToolsPartDesignManipulator: def modifyMenuBar(self): return [ - { - "insert": "ZTools_DatumCreator", - "menuItem": "PartDesign_Boolean", - "after": "", - }, - { - "insert": "ZTools_DatumManager", - "menuItem": "ZTools_DatumCreator", - "after": "", - }, - { - "insert": "ZTools_EnhancedPocket", - "menuItem": "ZTools_DatumManager", - "after": "", - }, - { - "insert": "ZTools_RotatedLinearPattern", - "menuItem": "ZTools_EnhancedPocket", - "after": "", - }, + {"append": "ZTools_DatumCreator", "menuItem": "PartDesign_Body"}, + {"append": "ZTools_DatumManager", "menuItem": "PartDesign_Body"}, + {"append": "ZTools_EnhancedPocket", "menuItem": "PartDesign_Body"}, + {"append": "ZTools_RotatedLinearPattern", "menuItem": "PartDesign_Body"}, ]