diff --git a/src/Mod/PartDesign/App/FeatureGroove.cpp b/src/Mod/PartDesign/App/FeatureGroove.cpp index 9119213639..781ffe954d 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.cpp +++ b/src/Mod/PartDesign/App/FeatureGroove.cpp @@ -192,9 +192,8 @@ App::DocumentObjectExecReturn* Groove::execute() upToFace.move(invObjLoc); } else { - throw Base::RuntimeError( - "ProfileBased: Revolution up to first/last is not yet supported" - ); + // TODO: Implement finding the first face this revolution would intersect with + return new App::DocumentObjectExecReturn("Groove up to first is not yet supported"); } if (Reversed.getValue()) { diff --git a/src/Mod/PartDesign/App/FeatureRevolution.cpp b/src/Mod/PartDesign/App/FeatureRevolution.cpp index d6fe5e1e2b..9f27cc88db 100644 --- a/src/Mod/PartDesign/App/FeatureRevolution.cpp +++ b/src/Mod/PartDesign/App/FeatureRevolution.cpp @@ -214,9 +214,8 @@ App::DocumentObjectExecReturn* Revolution::execute() upToFace.move(invObjLoc); } else { - throw Base::RuntimeError( - "ProfileBased: Revolution up to first/last is not yet supported" - ); + // TODO: Implement finding the first face this revolution would intersect with + return new App::DocumentObjectExecReturn("Revolve up to first is not yet supported"); } if (Reversed.getValue()) { diff --git a/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp b/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp index 472e65b73f..a81c2e27f8 100644 --- a/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskRevolutionParameters.cpp @@ -44,6 +44,8 @@ #include "ViewProviderRevolution.h" #include "ReferenceSelection.h" +#include + using namespace PartDesignGui; using namespace Gui; @@ -200,6 +202,16 @@ void TaskRevolutionParameters::translateModeList(int index) ui->changeMode->addItem(tr("Through all")); } ui->changeMode->addItem(tr("To first")); + + // "To first" is not available for revolutions right now, but if we just don't add it, the index + // will be wrong. So disable it instead. Messy workaround for #27403 + auto toFirstIndex = ui->changeMode->count() - 1; + auto* model = qobject_cast(ui->changeMode->model()); + if (model) { + QStandardItem* item = model->item(toFirstIndex); + item->setFlags(item->flags() & ~Qt::ItemIsEnabled); + } + ui->changeMode->addItem(tr("Up to face")); ui->changeMode->addItem(tr("Two angles")); ui->changeMode->setCurrentIndex(index);