From 9c113357c5806365f4639ad4448b3354714ea17a Mon Sep 17 00:00:00 2001 From: Alexander Golubev Date: Sun, 28 Jun 2015 06:16:23 +0300 Subject: [PATCH] PartDesign: add migrating sketch support to MoveFeature command --- src/Mod/PartDesign/Gui/Command.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 8e609d908..2c142fb8d 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -405,8 +405,16 @@ void CmdPartDesignMoveFeature::activated(int iMsg) App::DocumentObject* prevSolidFeature = target->getPrevSolidFeature(); doCommand(Gui,"Gui.activeDocument().hide(\"%s\")", prevSolidFeature->getNameInDocument()); doCommand(Gui,"Gui.activeDocument().show(\"%s\")", (*f)->getNameInDocument()); + } else if ((*f)->getTypeId().isDerivedFrom(Sketcher::SketchObject::getClassTypeId())) { + Sketcher::SketchObject *sketch = static_cast(*f); + try { + PartDesignGui::Workbench::fixSketchSupport(sketch); + } catch (Base::Exception &) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Sketch plane cannot be migrated"), + QObject::tr("Please edit '%1' and redefine it to use a Base or Datum plane as the sketch plane."). + arg(QString::fromAscii(sketch->getNameInDocument()) ) ); + } } - // TODO: if we are inserting a sketch which wasn't part of any body try to set right support for it } }