PartDesign: Use AllowCompound user parameter along the workbench - fixes #23596

This commit is contained in:
marioalexis
2025-09-25 10:40:47 -03:00
committed by Chris Hennes
parent 68b754effd
commit 406c3ba42c
4 changed files with 27 additions and 1 deletions

View File

@@ -471,8 +471,15 @@ void CmdPartDesignMigrate::activated(int iMsg)
std::string bodyName = getUniqueObjectName (
std::string ( chainIt->back()->getNameInDocument() ).append ( "Body" ).c_str () ) ;
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
.GetUserParameter()
.GetGroup("BaseApp/Preferences/Mod/PartDesign");
bool allowCompound = hGrp->GetBool("AllowCompoundDefault", true);
// Create a body for the chain
doCommand ( Doc,"App.activeDocument().addObject('PartDesign::Body','%s')", bodyName.c_str () );
doCommand ( Doc,"App.ActiveDocument.getObject('%s').AllowCompound = %s", bodyName.c_str(), allowCompound ? "True" : "False");
doCommand ( Doc,"App.activeDocument().%s.addObject(App.ActiveDocument.%s)",
actPart->getNameInDocument (), bodyName.c_str () );
if (base) {