diff --git a/data/tests/PadTest.fcstd b/data/tests/PadTest.fcstd index 8a7223083..3fe36983e 100644 Binary files a/data/tests/PadTest.fcstd and b/data/tests/PadTest.fcstd differ diff --git a/data/tests/PocketTest.fcstd b/data/tests/PocketTest.fcstd index 6acf91ba0..106343306 100644 Binary files a/data/tests/PocketTest.fcstd and b/data/tests/PocketTest.fcstd differ diff --git a/src/Mod/Assembly/App/AppAssemblyPy.cpp b/src/Mod/Assembly/App/AppAssemblyPy.cpp index f9d0573bb..bee08c236 100644 --- a/src/Mod/Assembly/App/AppAssemblyPy.cpp +++ b/src/Mod/Assembly/App/AppAssemblyPy.cpp @@ -65,7 +65,8 @@ static PyObject * setActivePart(PyObject *self, PyObject *args) PartDesignGui::ActivePartObject = Item; PartDesignGui::ActiveAppDoc = Item->getDocument(); PartDesignGui::ActiveGuiDoc = Gui::Application::Instance->getDocument(PartDesignGui::ActiveAppDoc); - PartDesignGui::ActiveVp = dynamic_cast<Gui::ViewProviderDocumentObject*> (PartDesignGui::ActiveGuiDoc->getViewProvider(Item)) ; + PartDesignGui::ActiveVp = dynamic_cast<Gui::ViewProviderDocumentObject*> (PartDesignGui::ActiveGuiDoc->getViewProvider(Item)); + PartDesignGui::ActiveVp->show(); Item->IsActive.setValue(true); } else { // This handles the case of deactivating the workbench diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 87d2609e0..df36ff97c 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -176,20 +176,25 @@ void CmdPartDesignMoveTip::activated(int iMsg) if(!pcActiveBody) return; std::vector<App::DocumentObject*> features = getSelection().getObjectsOfType(Part::Feature::getClassTypeId()); - if (features.empty()) return; - App::DocumentObject* selFeature = features.front(); + App::DocumentObject* selFeature; - if (selFeature->getTypeId().isDerivedFrom(PartDesign::Body::getClassTypeId())) { + if (features.empty()) { // Insert at the beginning of this body selFeature = NULL; - } else if (!pcActiveBody->hasFeature(selFeature)) { - // Switch to other body - pcActiveBody = static_cast<PartDesign::Body*>(Part::BodyBase::findBodyOf(selFeature)); - if (pcActiveBody != NULL) - Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActivePart(App.activeDocument().%s)", - pcActiveBody->getNameInDocument()); - else - return; + } else { + selFeature = features.front(); + if (selFeature->getTypeId().isDerivedFrom(PartDesign::Body::getClassTypeId())) { + // Insert at the beginning of this body + selFeature = NULL; + } else if (!pcActiveBody->hasFeature(selFeature)) { + // Switch to other body + pcActiveBody = static_cast<PartDesign::Body*>(Part::BodyBase::findBodyOf(selFeature)); + if (pcActiveBody != NULL) + Gui::Command::doCommand(Gui::Command::Gui,"PartDesignGui.setActivePart(App.activeDocument().%s)", + pcActiveBody->getNameInDocument()); + else + return; + } } openCommand("Move insert point to selected feature"); diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp index 73a47eb72..e28d867d3 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp @@ -174,12 +174,10 @@ void ViewProviderBody::updateData(const App::Property* prop) // PartDesign workbench not active return PartGui::ViewProviderPart::updateData(prop); - if (prop->getTypeId() == App::PropertyBool::getClassTypeId() && strcmp(prop->getName(),"IsActive") == 0) { + if ((prop->getTypeId() == App::PropertyBool::getClassTypeId() && strcmp(prop->getName(),"IsActive") == 0) || + (prop->getTypeId() == App::PropertyLink::getClassTypeId() && strcmp(prop->getName(),"Tip") == 0) || + (prop->getTypeId() == App::PropertyLinkList::getClassTypeId() && strcmp(prop->getName(),"Model") == 0)) updateTree(); - } else if (prop->getTypeId() == App::PropertyLink::getClassTypeId() && strcmp(prop->getName(),"Tip") == 0) { - updateTree(); - } - // Note: The Model property only changes by itself (without the Tip also changing) if a feature is deleted somewhere // Update the visual size of datum lines and planes PartDesign::Body* body = static_cast<PartDesign::Body*>(getObject());