]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for Box Macro crash
authormpv <mpv@opencascade.com>
Thu, 9 Jul 2015 12:24:05 +0000 (15:24 +0300)
committermpv <mpv@opencascade.com>
Thu, 9 Jul 2015 12:24:05 +0000 (15:24 +0300)
src/Model/Model_Objects.cpp
src/PythonAPI/modeler/extrusion.py

index 1f15f72c2b36d057c0096f6d941242ee4c5751c6..b6ebc0869503af9379df4fadf77a5861af971e39 100644 (file)
@@ -118,10 +118,12 @@ void Model_Objects::addFeature(FeaturePtr theFeature, const FeaturePtr theAfterT
     }
     AddToRefArray(aFeaturesLab, aFeatureLab, aPrevFeateureLab);
 
-    initData(theFeature, aFeatureLab, TAG_FEATURE_ARGUMENTS);
     // keep the feature ID to restore document later correctly
     TDataStd_Comment::Set(aFeatureLab, theFeature->getKind().c_str());
     myFeatures.Bind(aFeatureLab, theFeature);
+    // must be after binding to the map because of "Box" macro feature that 
+    // creates other features in "initData"
+    initData(theFeature, aFeatureLab, TAG_FEATURE_ARGUMENTS);
     // event: feature is added
     static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_CREATED);
     ModelAPI_EventCreator::get()->sendUpdated(theFeature, anEvent);
index 3cea7291de1f2d123c6c38c58c785f7b58e1f50e..9b9b6de32babd623022b65b21a74f5e05e504651 100644 (file)
@@ -11,6 +11,7 @@ class Extrusion():
   def __init__ (self, part, sketch, size):
     """Inserts an extrusion of the given Sketch to the given Part and executes the operation."""
     self.my = part.addFeature("Extrusion")
+    self.my.string("CreationMethod").setValue("BySizes")
     self.my.data().selectionList("base").append(sketch.result(), sketch.buildShape())
     if size < 0:
           self.my.data().real("from_size").setValue(-size)