From: vsv Date: Thu, 20 Sep 2018 12:57:21 +0000 (+0300) Subject: Fix for sketch in ExtrusionCut operation X-Git-Tag: V9_2_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a2bd2efedb5f309a947b535a8f3e61d2d9489f11;p=modules%2Fshaper.git Fix for sketch in ExtrusionCut operation --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 8e83afc0d..03007a3eb 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -448,7 +448,13 @@ bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_View if (aSelAttr.get()) { ResultPtr aRes = std::dynamic_pointer_cast(thePrs->object()); if (aRes.get()) { - GeomShapePtr aShapePtr = ModelAPI_Tools::shape(aRes); + GeomShapePtr aShapePtr; + if (!aShape.get() || aShape->isNull()) { // selection happens in the OCC viewer + aShapePtr = ModelAPI_Tools::shape(aRes); + } + else { // selection happens in OB browser + aShapePtr = aShape; + } if (aShapePtr.get() && aShapePtr->isFace()) { const TopoDS_Shape& aTDShape = aShapePtr->impl(); setSketchPlane(aTDShape);