From bde06bdb0cd90a1ea338aa93bd1cfa13d1233bf5 Mon Sep 17 00:00:00 2001 From: Abdelhadi Wael Date: Sun, 23 Feb 2025 15:16:56 +0200 Subject: [PATCH] Updated PR with fixes --- src/Gui/CommandStructure.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Gui/CommandStructure.cpp b/src/Gui/CommandStructure.cpp index 7636cfd62b..382cfa53cd 100644 --- a/src/Gui/CommandStructure.cpp +++ b/src/Gui/CommandStructure.cpp @@ -71,12 +71,18 @@ void StdCmdPart::activated(int iMsg) // TODO We really must set label ourselves? (2015-08-17, Fat-Zer) doCommand(Doc,"App.activeDocument().%s.Label = '%s'", PartName.c_str(), QObject::tr(PartName.c_str()).toUtf8().data()); - doCommand(Doc, - "selected_objects = Gui.Selection.getSelection()\n" - "if len(selected_objects) > 1:\n" - " for obj in selected_objects:\n" - " App.activeDocument().%s.addObject(obj)\n", - PartName.c_str()); + + doCommand(Doc, + "selected_objects = Gui.Selection.getSelection()\n" + "if len(selected_objects) > 1:\n" + " for obj in selected_objects:\n" + " App.activeDocument().%s.addObject(obj)", + PartName.c_str()); + + doCommand(Gui::Command::Gui, "Gui.activateView('Gui::View3DInventor', True)\n" + "Gui.activeView().setActiveObject('%s', App.activeDocument().%s)", + PARTKEY, PartName.c_str()); + updateActive(); }