From: mpv Date: Thu, 9 Jul 2015 12:24:05 +0000 (+0300) Subject: Fix for Box Macro crash X-Git-Tag: V_1.3.0~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2732872dd73bbc93a33bce53067c81245b55c0a4;p=modules%2Fshaper.git Fix for Box Macro crash --- diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 1f15f72c2..b6ebc0869 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -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); diff --git a/src/PythonAPI/modeler/extrusion.py b/src/PythonAPI/modeler/extrusion.py index 3cea7291d..9b9b6de32 100644 --- a/src/PythonAPI/modeler/extrusion.py +++ b/src/PythonAPI/modeler/extrusion.py @@ -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)