Salome HOME
Issue #1711: Dump study/Load saved script - tuple index out of range
authordbv <dbv@opencascade.com>
Fri, 2 Sep 2016 12:01:07 +0000 (15:01 +0300)
committerdbv <dbv@opencascade.com>
Fri, 2 Sep 2016 12:01:07 +0000 (15:01 +0300)
Fixed

src/FeaturesAPI/FeaturesAPI_Extrusion.cpp
src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp
src/FeaturesAPI/FeaturesAPI_Revolution.cpp
src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp

index bb2cb99ac246ccbb05b103d702f8411de3d4af54..62f0d047021bf1b7581619610c4ac3c952a2651f 100644 (file)
@@ -113,6 +113,10 @@ FeaturesAPI_Extrusion::~FeaturesAPI_Extrusion()
 void FeaturesAPI_Extrusion::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());
index 26307f4e76ac968af5d5e0d022fa4da9bef78efe..974f076945f4c741e3ada9c5a8087dd99e3b9805 100644 (file)
@@ -26,6 +26,10 @@ FeaturesAPI_ExtrusionBoolean::~FeaturesAPI_ExtrusionBoolean()
 void FeaturesAPI_ExtrusionBoolean::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());
index 061a974579fceecd635db1d4124000c1a2af674a..173a61594593bac2b2a29b518246a360cb1ee31e 100644 (file)
@@ -74,6 +74,10 @@ 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());
index 118bd2fe85cdaf129c1ed3712e0d3a83f4bd2db4..cf897c96065492103f420e92e7b30a65d5be198c 100644 (file)
@@ -26,6 +26,10 @@ FeaturesAPI_RevolutionBoolean::~FeaturesAPI_RevolutionBoolean()
 void FeaturesAPI_RevolutionBoolean::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());