PartDesign: Remove use of user parameters from Body constructor
This commit is contained in:
committed by
Kacper Donat
parent
7d4e704030
commit
94d20bbc95
@@ -41,18 +41,11 @@ using namespace PartDesign;
|
||||
|
||||
PROPERTY_SOURCE(PartDesign::Body, Part::BodyBase)
|
||||
|
||||
Body::Body() {
|
||||
Body::Body()
|
||||
{
|
||||
ADD_PROPERTY_TYPE(AllowCompound, (false), "Experimental", App::Prop_None, "Allow multiple solids in Body (experimental)");
|
||||
|
||||
_GroupTouched.setStatus(App::Property::Output, true);
|
||||
|
||||
static Base::Reference<ParameterGrp> hGrp = App::GetApplication()
|
||||
.GetUserParameter()
|
||||
.GetGroup("BaseApp/Preferences/Mod/PartDesign");
|
||||
|
||||
auto allowCompoundDefaultValue = hGrp->GetBool("AllowCompoundDefault", true);
|
||||
|
||||
ADD_PROPERTY(AllowCompound, (allowCompoundDefaultValue));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -104,6 +104,11 @@ void CmdPartDesignBody::activated(int iMsg)
|
||||
App::DocumentObject* baseFeature = nullptr;
|
||||
bool addtogroup = false;
|
||||
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication()
|
||||
.GetUserParameter()
|
||||
.GetGroup("BaseApp/Preferences/Mod/PartDesign");
|
||||
|
||||
bool allowCompound = hGrp->GetBool("AllowCompoundDefault", true);
|
||||
|
||||
if (!features.empty()) {
|
||||
if (features.size() == 1) {
|
||||
@@ -196,6 +201,7 @@ void CmdPartDesignBody::activated(int iMsg)
|
||||
std::string labelString = QObject::tr("Body").toUtf8().toStdString();
|
||||
labelString = Base::Tools::escapeEncodeString(labelString);
|
||||
doCommand(Doc,"App.ActiveDocument.getObject('%s').Label = '%s'", bodyString, labelString.c_str());
|
||||
doCommand(Doc,"App.ActiveDocument.getObject('%s').AllowCompound = %s", bodyString, allowCompound ? "True" : "False");
|
||||
if (baseFeature) {
|
||||
if (partOfBaseFeature){
|
||||
//withdraw base feature from Part, otherwise visibility madness results
|
||||
|
||||
Reference in New Issue
Block a user