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)