- boost::shared_ptr<ModelAPI_Feature> aFeature = *anIt;
- if (myModule->workshop()->displayer()->IsVisible(aFeature) ||
- aType == EVENT_FEATURE_CREATED) {
- myModule->visualizePreview(aFeature, true, false);
- if (aType == EVENT_FEATURE_CREATED)
- myModule->activateFeature(aFeature, true);
+ ObjectPtr aObj = (*anIt);
+ aDisplayer->deactivate(aObj);
+ boost::shared_ptr<ModelAPI_Feature> aFeature =
+ boost::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
+ if (aFeature && (aFeature->getKind() == "Sketch")) // Activate sketcher for planes selection
+ myModule->activateFeature(aFeature, false);
+ // If current operation is Sketch then there is no active sketching operation
+ // and possible the object was created by Redo operatgion
+ else if (aSketchOp) {
+ XGUI_Displayer* aDisplayer = myModule->workshop()->displayer();
+ // Very possible it is not displayed
+ aDisplayer->display(aObj, false);
+ std::list<int> aModes = aSketchOp->getSelectionModes(aObj);
+ aDisplayer->activateInLocalContext(aObj, aModes, false);