diff --git a/src/Mod/PartDesign/Gui/Utils.cpp b/src/Mod/PartDesign/Gui/Utils.cpp index fc1c92b434..81099b3827 100644 --- a/src/Mod/PartDesign/Gui/Utils.cpp +++ b/src/Mod/PartDesign/Gui/Utils.cpp @@ -89,12 +89,14 @@ bool setEdit(App::DocumentObject *obj, PartDesign::Body *body) { return false; App::DocumentObject *parent = nullptr; std::string subname; - auto activeBody = activeView->getActiveObject(PDBODYKEY); + auto activeBody = activeView->getActiveObject(PDBODYKEY, &parent, &subname); if (activeBody != body) { parent = obj; + subname.clear(); } else { - parent = getParent(obj, subname); + subname += obj->getNameInDocument(); + subname += '.'; } Gui::cmdGuiDocument(parent, std::ostringstream() << "setEdit("