diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 6e6cb60a4..6c5506c3f 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -3839,8 +3839,6 @@ void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector & // ====================================================================================== -//DEF_STD_CMD_A(CmdSketcherConstrainTangent); - class CmdSketcherConstrainTangent : public CmdSketcherConstraint { public: @@ -4492,7 +4490,7 @@ CmdSketcherConstrainRadius::CmdSketcherConstrainRadius() sAccel = "SHIFT+R"; eType = ForEdit; - allowedSelSequences = {{SelEdge}}; + allowedSelSequences = {{SelEdge}, {SelExternalEdge}}; constraintCursor = cursor_genericconstraint; } @@ -4798,6 +4796,8 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector &selSeq, switch (seqIndex) { case 0: // {SelEdge} + case 1: // {SelExternalEdge} + { const Part::Geometry *geom = Obj->getGeometry(GeoId); if (geom && geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { const Part::GeomArcOfCircle *arc = static_cast(geom); @@ -4822,7 +4822,7 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector &selSeq, int indexConstr = ConStr.size() - 1; - if(constraintCreationMode==Reference) { + if(GeoId <= Sketcher::GeoEnum::RefExt || constraintCreationMode==Reference) { Gui::Command::doCommand(Doc, "App.ActiveDocument.%s.setDriving(%i,%s)", Obj->getNameInDocument(), ConStr.size()-1, "False"); } @@ -4842,7 +4842,7 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector &selSeq, ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); bool show = hGrp->GetBool("ShowDialogOnDistanceConstraint", true); // Ask for the value of the radius immediately - if (show && constraintCreationMode==Driving) { + if (show && constraintCreationMode==Driving && GeoId >= 0) { QDialog dlg(Gui::getMainWindow()); Ui::InsertDatum ui_Datum; ui_Datum.setupUi(&dlg); @@ -4928,6 +4928,7 @@ void CmdSketcherConstrainRadius::applyConstraint(std::vector &selSeq, Obj->solve(); } } + } } void CmdSketcherConstrainRadius::updateAction(int mode)