+ Add selected sketches to one Face, implement specialized view provider for Face

This commit is contained in:
wmayer
2015-11-13 13:38:24 +01:00
parent 6944658bd4
commit bf0d8d68bb
5 changed files with 118 additions and 32 deletions

View File

@@ -1034,7 +1034,7 @@ CmdPartMakeFace::CmdPartMakeFace()
sAppModule = "Part";
sGroup = QT_TR_NOOP("Part");
sMenuText = QT_TR_NOOP("Make face from sketch");
sToolTipText = QT_TR_NOOP("Make face from a selected sketch");
sToolTipText = QT_TR_NOOP("Make face from selected sketches");
sWhatsThis = "Part_MakeFace";
sStatusTip = sToolTipText;
}
@@ -1043,16 +1043,27 @@ void CmdPartMakeFace::activated(int iMsg)
{
std::vector<Part::Part2DObject*> sketches = Gui::Selection().getObjectsOfType<Part::Part2DObject>();
openCommand("Make face");
for (std::vector<Part::Part2DObject*>::iterator it = sketches.begin(); it != sketches.end(); ++it) {
App::DocumentObjectT obj(*it);
try {
App::DocumentT doc(sketches.front()->getDocument());
std::stringstream str;
str << obj.getDocumentPython()
<< ".addObject(\"Part::Face\", \"Face\").Sources = "
<< obj.getObjectPython();
str << doc.getDocumentPython()
<< ".addObject(\"Part::Face\", \"Face\").Sources = (";
for (std::vector<Part::Part2DObject*>::iterator it = sketches.begin(); it != sketches.end(); ++it) {
App::DocumentObjectT obj(*it);
str << obj.getObjectPython() << ", ";
}
str << ")";
doCommand(Doc,str.str().c_str());
commitCommand();
updateActive();
}
catch (...) {
abortCommand();
throw;
}
commitCommand();
updateActive();
}
bool CmdPartMakeFace::isActive(void)