diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp index 21ab78c6bc..02f0103d2f 100644 --- a/src/Mod/TechDraw/Gui/Command.cpp +++ b/src/Mod/TechDraw/Gui/Command.cpp @@ -33,8 +33,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -253,12 +255,17 @@ void CmdTechDrawNewView::activated(int iMsg) return; } - std::vector shapes = getSelection().getObjectsOfType(App::DocumentObject::getClassTypeId()); - if (shapes.empty()) { + std::vector shapes = getSelection().getObjectsOfType(App::GeoFeature::getClassTypeId()); + std::vector groups = getSelection().getObjectsOfType(App::DocumentObjectGroup::getClassTypeId()); + if ((shapes.empty()) && + (groups.empty())) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Can not make a View from this selection")); return; } + if (!groups.empty()) { + shapes.insert(shapes.end(),groups.begin(),groups.end()); + } std::string PageName = page->getNameInDocument(); @@ -446,12 +453,17 @@ void CmdTechDrawProjGroup::activated(int iMsg) return; } - std::vector shapes = getSelection().getObjectsOfType(Part::Feature::getClassTypeId()); - if (shapes.empty()) { + std::vector shapes = getSelection().getObjectsOfType(App::GeoFeature::getClassTypeId()); + std::vector groups = getSelection().getObjectsOfType(App::DocumentObjectGroup::getClassTypeId()); + if ((shapes.empty()) && + (groups.empty())) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - QObject::tr("Can not make a ProjectionGroup from this selection.")); + QObject::tr("Can not make a ProjectionGroup from this selection")); return; } + if (!groups.empty()) { + shapes.insert(shapes.end(),groups.begin(),groups.end()); + } std::string PageName = page->getNameInDocument();