PartDesign: Use AllowCompound user parameter along the workbench - fixes #23596
This commit is contained in:
committed by
Chris Hennes
parent
68b754effd
commit
406c3ba42c
@@ -189,11 +189,22 @@ void needActiveBodyError()
|
||||
|
||||
PartDesign::Body * makeBody(App::Document *doc)
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
|
||||
.GetUserParameter()
|
||||
.GetGroup("BaseApp/Preferences/Mod/PartDesign");
|
||||
|
||||
bool allowCompound = hGrp->GetBool("AllowCompoundDefault", true);
|
||||
|
||||
// This is intended as a convenience when starting a new document.
|
||||
auto bodyName( doc->getUniqueObjectName("Body") );
|
||||
Gui::Command::doCommand( Gui::Command::Doc,
|
||||
"App.getDocument('%s').addObject('PartDesign::Body','%s')",
|
||||
doc->getName(), bodyName.c_str() );
|
||||
Gui::Command::doCommand( Gui::Command::Doc,
|
||||
"App.getDocument('%s').getObject('%s').AllowCompound = %s",
|
||||
doc->getName(), bodyName.c_str(), allowCompound ? "True" : "False" );
|
||||
|
||||
|
||||
auto body = dynamic_cast<PartDesign::Body*>(doc->getObject(bodyName.c_str()));
|
||||
if(body)
|
||||
makeBodyActive(body, doc);
|
||||
|
||||
Reference in New Issue
Block a user