updating to setActiveObject call

This commit is contained in:
blobfish
2015-04-29 10:17:22 -04:00
committed by Stefan Tröger
parent d112c41eca
commit 6877cbbd51
3 changed files with 5 additions and 5 deletions

View File

@@ -123,7 +123,7 @@ void CmdPartDesignBody::activated(int iMsg)
//doCommand(Doc,"App.activeDocument().%s.Model = []",FeatName.c_str());
//doCommand(Doc,"App.activeDocument().%s.Tip = None",FeatName.c_str());
addModule(Gui,"PartDesignGui"); // import the Gui module only once a session
doCommand(Gui,"PartDesignGui.setActiveBody(App.ActiveDocument.%s)", FeatName.c_str());
doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('Body',App.activeDocument().%s)", FeatName.c_str());
// Make the "Create sketch" prompt appear in the task panel
doCommand(Gui,"Gui.Selection.clearSelection()");
doCommand(Gui,"Gui.Selection.addSelection(App.ActiveDocument.%s)", FeatName.c_str());
@@ -174,7 +174,7 @@ void CmdPartDesignMoveTip::activated(int iMsg)
// Switch to other body
pcActiveBody = static_cast<PartDesign::Body*>(Part::BodyBase::findBodyOf(selFeature));
if (pcActiveBody != NULL)
Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActiveBody(App.activeDocument().%s)",
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('Body',App.activeDocument().%s)",
pcActiveBody->getNameInDocument());
else
return;
@@ -244,7 +244,7 @@ void CmdPartDesignDuplicateSelection::activated(int iMsg)
// Switch to other body
pcActiveBody = static_cast<PartDesign::Body*>(Part::BodyBase::findBodyOf(selFeature));
if (pcActiveBody != NULL)
Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActiveBody(App.activeDocument().%s)",
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('Body',App.activeDocument().%s)",
pcActiveBody->getNameInDocument());
else
return;

View File

@@ -105,7 +105,7 @@ bool ViewProviderBody::doubleClicked(void)
// assure the PartDesign workbench
Gui::Command::assureWorkbench("PartDesignWorkbench");
//Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActiveBody(App.activeDocument().%s)",this->getObject()->getNameInDocument());
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeView.setActiveBody(App.activeDocument().%s)",this->getObject()->getNameInDocument());
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('Body',App.activeDocument().%s)",this->getObject()->getNameInDocument());
return true;
}

View File

@@ -682,7 +682,7 @@ void Workbench::deactivated()
removeTaskWatcher();
// reset the active Body
Gui::Command::doCommand(Gui::Command::Doc,"import PartDesignGui");
Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActiveBody(None)");
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeView().setActiveObject('Body',App.activeDocument().%s)", "None");
Gui::Workbench::deactivated();