Skip to content

Commit

Permalink
fix groove
Browse files Browse the repository at this point in the history
  • Loading branch information
usakhelo authored and wwmayer committed Mar 18, 2017
1 parent ea45280 commit d23e603
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Mod/PartDesign/Gui/Command.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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<PartDesign::Groove*>(cmd->getDocument()->getObject(FeatName.c_str()));
if (pcGroove && pcGroove->suggestReversed())
Expand Down

0 comments on commit d23e603

Please sign in to comment.