From 59b01f6802aec10f17c51bfb55b954c340684387 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Wed, 20 Aug 2025 12:34:27 +0200 Subject: [PATCH] Assembly: toggle grounded: handle case of grounded joint selection. --- src/Mod/Assembly/CommandCreateJoint.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Mod/Assembly/CommandCreateJoint.py b/src/Mod/Assembly/CommandCreateJoint.py index 81ac559255..1d9346e536 100644 --- a/src/Mod/Assembly/CommandCreateJoint.py +++ b/src/Mod/Assembly/CommandCreateJoint.py @@ -516,6 +516,19 @@ class CommandToggleGrounded: # If you select 2 solids (bodies for example) within an assembly. # There'll be a single sel but 2 SubElementNames. for sub in sel.SubElementNames: + # First check if selection is a grounded object + resolved = sel.Object.resolveSubElement(sub) + if resolved: + obj = resolved[0] + if hasattr(obj, "ObjectToGround"): + commands = ( + "doc = App.ActiveDocument\n" + f'doc.removeObject("{obj.Name}")\n' + "doc.recompute()\n" + ) + Gui.doCommand(commands) + continue + ref = [sel.Object, [sub, sub]] moving_part = UtilsAssembly.getMovingPart(assembly, ref)