From a2bd2efedb5f309a947b535a8f3e61d2d9489f11 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 20 Sep 2018 15:57:21 +0300 Subject: [PATCH] Fix for sketch in ExtrusionCut operation --- src/PartSet/PartSet_WidgetSketchLabel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.2