Salome HOME
Issue #1711: Dump study/Load saved script - tuple index out of range
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Revolution.cpp
index 6c09db9f22251506fb1162c51f481479d92639f1..173a61594593bac2b2a29b518246a360cb1ee31e 100644 (file)
@@ -74,6 +74,16 @@ FeaturesAPI_Revolution::~FeaturesAPI_Revolution()
 void FeaturesAPI_Revolution::setNestedSketch(const ModelHighAPI_Reference& theSketch)
 {
   mysketch->setValue(theSketch.feature());
+
+  // To make Sketch feature execute and subfeatures execute.
+  feature()->document()->setCurrentFeature(feature(), false);
+
+  // to inform that the history is updated due to the sketch moved under the composite feature
+  if (theSketch.feature().get()) {
+    theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
+    if (theSketch.feature()->firstResult().get())
+      theSketch.feature()->firstResult()->setDisplayed(false);
+  }
   mybaseObjects->clear();
   mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());