Slightly change start up code to run Workbench activate later and some implementations

This commit is contained in:
jriegel
2012-04-05 20:47:02 +02:00
committed by Stefan Tröger
parent 29507a44ed
commit d5663b4122
6 changed files with 43 additions and 7 deletions

View File

@@ -67,10 +67,13 @@ void CmdAssemblyAddNewPart::activated(int iMsg)
dest = dynamic_cast<Assembly::ItemAssembly*>(Sel.front());
}else if(ActiveAsmObject && ActiveAsmObject->getTypeId().isDerivedFrom(Assembly::ItemAssembly::getClassTypeId())) {
dest = dynamic_cast<Assembly::ItemAssembly*>(ActiveAsmObject);
}else {
}
openCommand("Insert Part");
std::string PartName = getUniqueObjectName("Part.0");
std::string PartName = getUniqueObjectName("Part");
doCommand(Doc,"App.activeDocument().addObject('Assembly::ItemPart','%s')",PartName.c_str());
if(dest){
std::string fatherName = dest->getNameInDocument();
@@ -80,7 +83,7 @@ void CmdAssemblyAddNewPart::activated(int iMsg)
Command::addModule(Gui,"PartDesignGui");
std::string BodyName = getUniqueObjectName("Body");
doCommand(Doc,"App.activeDocument().addObject('PartDesign::Body','%s')",BodyName.c_str());
doCommand(Doc,"App.activeDocument().%s.Model = App.activeDocument().%s.Items = App.activeDocument().%s ",BodyName.c_str(),BodyName.c_str(),BodyName.c_str());
doCommand(Doc,"App.activeDocument().%s.Model = App.activeDocument().%s ",PartName.c_str(),BodyName.c_str(),BodyName.c_str());
}