diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index b4002651b3..f3c7d3176d 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -999,7 +999,7 @@ void CmdPartDesignRevolution::activated(int iMsg) return; Gui::Command* cmd = this; - auto worker = [this, cmd, pcActiveBody](Part::Feature* sketch, std::string FeatName) { + auto worker = [this, cmd, &pcActiveBody](Part::Feature* sketch, std::string FeatName) { if (FeatName.empty()) return; @@ -1059,12 +1059,19 @@ void CmdPartDesignGroove::activated(int iMsg) return; Gui::Command* cmd = this; - auto worker = [this, cmd](Part::Feature* sketch, std::string FeatName) { + auto worker = [this, cmd, &pcActiveBody](Part::Feature* sketch, std::string FeatName) { if (FeatName.empty()) return; - Gui::Command::doCommand(Doc,"App.activeDocument().%s.ReferenceAxis = (App.activeDocument().%s,['V_Axis'])", - FeatName.c_str(), sketch->getNameInDocument()); + if (sketch->isDerivedFrom(Part::Part2DObject::getClassTypeId())) { + Gui::Command::doCommand(Doc, "App.activeDocument().%s.ReferenceAxis = (App.activeDocument().%s,['V_Axis'])", + FeatName.c_str(), sketch->getNameInDocument()); + } + else { + Gui::Command::doCommand(Doc, "App.activeDocument().%s.ReferenceAxis = (App.activeDocument().%s,[\"\"])", + FeatName.c_str(), pcActiveBody->getOrigin()->getY()->getNameInDocument()); + } + Gui::Command::doCommand(Doc,"App.activeDocument().%s.Angle = 360.0",FeatName.c_str()); PartDesign::Groove* pcGroove = static_cast(cmd->getDocument()->getObject(FeatName.c_str())); if (pcGroove && pcGroove->suggestReversed())