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

@@ -80,6 +80,7 @@ PartDesign::Body *getBody(bool messageIfNot, bool autoActivate, bool assertModer
if (!activeBody && singleBodyDocument && autoActivate) {
Gui::Command::doCommand( Gui::Command::Gui,
"Gui.activateView('Gui::View3DInventor', True)\n"
"Gui.activeView().setActiveObject('pdbody',App.ActiveDocument.findObjects('PartDesign::Body')[0])");
activeBody = activeView->getActiveObject<PartDesign::Body*>(PDBODYKEY);
return activeBody;