From 01abde5f9c595b7ce15c439c03047477b94a51d1 Mon Sep 17 00:00:00 2001 From: mpv Date: Thu, 29 Nov 2018 13:51:21 +0300 Subject: [PATCH] Make sketch drawer work with construction planes correctly --- src/SketchPlugin/SketchPlugin_SketchDrawer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp b/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp index cc3b90f90..b69c51305 100644 --- a/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp +++ b/src/SketchPlugin/SketchPlugin_SketchDrawer.cpp @@ -79,6 +79,8 @@ void SketchPlugin_SketchDrawer::execute() ObjectPtr aPlaneContext = selection(PLANE_ID())->contextObject(); GeomShapePtr aPlaneShape = selection(PLANE_ID())->value(); + if (!aPlaneShape.get() && aPlaneContext.get()) + aPlaneShape = selection(PLANE_ID())->context()->shape(); if (!aPlaneShape.get() || aPlaneShape->shapeType() != GeomAPI_Shape::FACE) { setError("Error: a sketch plane can not be obtained"); return; // invalid case @@ -93,11 +95,9 @@ void SketchPlugin_SketchDrawer::execute() // by selection of plane aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> setValue(selection(PLANE_ID())->context(), aPlaneShape); - // if reference to non-construction, remove reference, but keep the sketch position - if (aPlaneContext->groupName() != ModelAPI_ResultConstruction::group()) { - aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> - setValue(ResultPtr(), GeomShapePtr()); - } + // remove reference, but keep the sketch position + aSketch->selection(SketchPlugin_SketchEntity::EXTERNAL_ID())-> + setValue(ResultPtr(), GeomShapePtr()); // iterate all edges of the base to find all edges that belong to this plane GeomAPI_DataMapOfShapeShape alreadyProcessed; -- 2.39.2