X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Sketch.cpp;h=d1deff5364ac1e1f9369a33889243ee28db68c1b;hb=b5893b0a30fac08134c24de4565cb513a43affa6;hp=9f6b63a77ba0a12d80460194684b86eb3cd2ecec;hpb=4c82c364b298ebdb1c1d89d69e5086c33df52f2b;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index 9f6b63a77..d1deff536 100755 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -139,6 +139,7 @@ std::shared_ptr SketchPlugin_Sketch::addFeature(std::string th } // set as current also after it becomes sub to set correctly enabled for other sketch subs document()->setCurrentFeature(aNew, false); + return aNew; } @@ -212,9 +213,10 @@ bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const void SketchPlugin_Sketch::attributeChanged(const std::string& theID) { if (theID == SketchPlugin_SketchEntity::EXTERNAL_ID()) { - std::shared_ptr aSelection = - data()->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())->value(); - if (aSelection) { // update arguments due to the selection value + AttributeSelectionPtr aSelAttr = selection(SketchPlugin_SketchEntity::EXTERNAL_ID()); + if (aSelAttr->context().get()) { // update arguments due to the selection value + std::shared_ptr aSelection = aSelAttr->value(); + if (!aSelection.get()) aSelection = aSelAttr->context()->shape(); // update the sketch plane std::shared_ptr aFace(new GeomAPI_Face(aSelection)); std::shared_ptr aPlane = aFace->getPlane();