activate/create 3d view when setting or getting active objects

This commit is contained in:
wmayer
2019-07-05 18:53:35 +02:00
parent 8b0ee4c4a2
commit c3763479da
7 changed files with 13 additions and 2 deletions

View File

@@ -152,6 +152,7 @@ bool ViewProviderBody::doubleClicked(void)
if (activeBody == this->getObject()){
//active body double-clicked. Deactivate.
Gui::Command::doCommand(Gui::Command::Gui,
"Gui.activateView('Gui::View3DInventor', True)\n"
"Gui.getDocument('%s').ActiveView.setActiveObject('%s', None)",
this->getObject()->getDocument()->getName(),
PDBODYKEY);
@@ -164,6 +165,7 @@ bool ViewProviderBody::doubleClicked(void)
auto* part = App::Part::getPartOfObject ( getObject() );
if ( part && part != getActiveView()->getActiveObject<App::Part*> ( PARTKEY ) ) {
Gui::Command::doCommand(Gui::Command::Gui,
"Gui.activateView('Gui::View3DInventor', True)\n"
"Gui.getDocument('%s').ActiveView.setActiveObject('%s', App.getDocument('%s').getObject('%s'))",
part->getDocument()->getName(),
PARTKEY,
@@ -172,6 +174,7 @@ bool ViewProviderBody::doubleClicked(void)
}
Gui::Command::doCommand(Gui::Command::Gui,
"Gui.activateView('Gui::View3DInventor', True)\n"
"Gui.getDocument('%s').ActiveView.setActiveObject('%s', App.getDocument('%s').getObject('%s'))",
this->getObject()->getDocument()->getName(),
PDBODYKEY,