diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 4d61b79c49..e5ccaaac5f 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -258,7 +258,8 @@ void CmdPartCut::activated(int iMsg) doCommand(Doc,"App.activeDocument().%s.Tool = App.activeDocument().%s",FeatName.c_str(),ToolName.c_str()); doCommand(Gui,"Gui.activeDocument().hide('%s')",BaseName.c_str()); doCommand(Gui,"Gui.activeDocument().hide('%s')",ToolName.c_str()); - doCommand(Gui,"Gui.activeDocument().%s.ShapeColor = Gui.activeDocument().%s.ShapeColor", FeatName.c_str(),BaseName.c_str()); + copyVisual(FeatName.c_str(), "ShapeColor", BaseName.c_str()); + copyVisual(FeatName.c_str(), "DisplayMode", BaseName.c_str()); updateActive(); commitCommand(); } @@ -310,7 +311,8 @@ void CmdPartCommon::activated(int iMsg) doCommand(Doc,"App.activeDocument().%s.Shapes = [%s]",FeatName.c_str(),ObjectBuf.c_str()); for (std::vector::iterator it = tempSelNames.begin(); it != tempSelNames.end(); ++it) doCommand(Gui,"Gui.activeDocument().%s.Visibility=False",it->c_str()); - doCommand(Gui,"Gui.activeDocument().%s.ShapeColor = Gui.activeDocument().%s.ShapeColor", FeatName.c_str(),tempSelNames.front().c_str()); + copyVisual(FeatName.c_str(), "ShapeColor", tempSelNames.front().c_str()); + copyVisual(FeatName.c_str(), "DisplayMode", tempSelNames.front().c_str()); updateActive(); commitCommand(); } @@ -362,7 +364,8 @@ void CmdPartFuse::activated(int iMsg) doCommand(Doc,"App.activeDocument().%s.Shapes = [%s]",FeatName.c_str(),ObjectBuf.c_str()); for (std::vector::iterator it = tempSelNames.begin(); it != tempSelNames.end(); ++it) doCommand(Gui,"Gui.activeDocument().%s.Visibility=False",it->c_str()); - doCommand(Gui,"Gui.activeDocument().%s.ShapeColor = Gui.activeDocument().%s.ShapeColor", FeatName.c_str(),tempSelNames.front().c_str()); + copyVisual(FeatName.c_str(), "ShapeColor", tempSelNames.front().c_str()); + copyVisual(FeatName.c_str(), "DisplayMode", tempSelNames.front().c_str()); updateActive(); commitCommand(); } diff --git a/src/Mod/Part/Gui/DlgBooleanOperation.cpp b/src/Mod/Part/Gui/DlgBooleanOperation.cpp index 96956d46d7..87d766e855 100644 --- a/src/Mod/Part/Gui/DlgBooleanOperation.cpp +++ b/src/Mod/Part/Gui/DlgBooleanOperation.cpp @@ -386,9 +386,8 @@ void DlgBooleanOperation::accept() "Gui.activeDocument().hide(\"%s\")",shapeOne.c_str()); Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().hide(\"%s\")",shapeTwo.c_str()); - Gui::Command::doCommand(Gui::Command::Gui, - "Gui.activeDocument().%s.ShapeColor = Gui.activeDocument().%s.ShapeColor", - objName.c_str(),shapeOne.c_str()); + Gui::Command::copyVisual(objName.c_str(), "ShapeColor", shapeOne.c_str()); + Gui::Command::copyVisual(objName.c_str(), "DisplayMode", shapeOne.c_str()); activeDoc->commitTransaction(); activeDoc->recompute(); }