Merge pull request #11750 from realthunder/FixActiveBody

Fix object path in active object when creating new body in App::Part
This commit is contained in:
sliptonic
2024-01-08 10:47:45 -06:00
committed by GitHub
2 changed files with 32 additions and 6 deletions

View File

@@ -212,6 +212,12 @@ void CmdPartDesignBody::activated(int iMsg)
}
}
addModule(Gui,"PartDesignGui"); // import the Gui module only once a session
if (actPart) {
doCommand(Doc,"App.activeDocument().%s.addObject(App.ActiveDocument.%s)",
actPart->getNameInDocument(), bodyString);
}
doCommand(Gui::Command::Gui, "Gui.activateView('Gui::View3DInventor', True)\n"
"Gui.activeView().setActiveObject('%s', App.activeDocument().%s)",
PDBODYKEY, bodyString);
@@ -219,10 +225,6 @@ void CmdPartDesignBody::activated(int iMsg)
// Make the "Create sketch" prompt appear in the task panel
doCommand(Gui,"Gui.Selection.clearSelection()");
doCommand(Gui,"Gui.Selection.addSelection(App.ActiveDocument.%s)", bodyString);
if (actPart) {
doCommand(Doc,"App.activeDocument().%s.addObject(App.ActiveDocument.%s)",
actPart->getNameInDocument(), bodyString);
}
// check if a proxy object has been created for the base feature inside the body
if (baseFeature) {