From f6ba6cb99c6fd580b3c776716fb85510f5bed7d4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 1 Oct 2017 22:10:00 +0200 Subject: [PATCH] issue #0002304: Duplicate multi selection of sketch element produces many sketches --- src/Mod/Part/Gui/CommandSimple.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 4342826050..31dea7cb21 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -180,20 +180,20 @@ void CmdPartSimpleCopy::activated(int iMsg) { Q_UNUSED(iMsg); Base::Type partid = Base::Type::fromName("Part::Feature"); - std::vector objs = Gui::Selection().getObjectsOfType(partid); + std::vector objs = Gui::Selection().getSelectionEx(0, partid); openCommand("Create Copy"); - for (std::vector::iterator it = objs.begin(); it != objs.end(); ++it) { + for (std::vector::iterator it = objs.begin(); it != objs.end(); ++it) { doCommand(Doc,"App.ActiveDocument.addObject('Part::Feature','%s').Shape=" "App.ActiveDocument.%s.Shape\n" "App.ActiveDocument.ActiveObject.Label=" "App.ActiveDocument.%s.Label\n", - (*it)->getNameInDocument(), - (*it)->getNameInDocument(), - (*it)->getNameInDocument()); - copyVisual("ActiveObject", "ShapeColor", (*it)->getNameInDocument()); - copyVisual("ActiveObject", "LineColor", (*it)->getNameInDocument()); - copyVisual("ActiveObject", "PointColor", (*it)->getNameInDocument()); - copyVisual("ActiveObject", "DiffuseColor", (*it)->getNameInDocument()); + it->getFeatName(), + it->getFeatName(), + it->getFeatName()); + copyVisual("ActiveObject", "ShapeColor", it->getFeatName()); + copyVisual("ActiveObject", "LineColor", it->getFeatName()); + copyVisual("ActiveObject", "PointColor", it->getFeatName()); + copyVisual("ActiveObject", "DiffuseColor", it->getFeatName()); } commitCommand(); updateActive();