PartDesign: Fillet, Chamfer, Draft, Thickness : Enable tool to start with no selection.

This commit is contained in:
Paddle
2023-03-22 15:25:31 +01:00
parent 1689c99930
commit bc22bf9c0d
19 changed files with 288 additions and 497 deletions

View File

@@ -102,15 +102,21 @@ App::DocumentObjectExecReturn *Draft::execute()
Part::TopoShape TopShape;
try {
TopShape = getBaseShape();
} catch (Base::Exception& e) {
}
catch (Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
// Faces where draft should be applied
// Note: Cannot be const reference currently because of BRepOffsetAPI_DraftAngle::Remove() bug, see below
std::vector<std::string> SubVals = Base.getSubValuesStartsWith("Face");
if (SubVals.empty())
return new App::DocumentObjectExecReturn("No faces specified");
//If no element is selected, then we use a copy of previous feature.
if (SubVals.empty()) {
this->positionByBaseFeature();
this->Shape.setValue(TopShape);
return App::DocumentObject::StdReturn;
}
// Draft angle
double angle = Base::toRadians(Angle.getValue());