From 20a4dc38391daddf56d15ad802f0c5f600b6dc7c Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 27 Jan 2025 10:21:32 +0100 Subject: [PATCH] PD: Restore GUI commands for PartDesign datum objects With PR 19114 the commands to create PD datum objects are replaced with the counterparts of Part. However, PD datum objects are much more powerful than the Part datum objects. (see e.g. https://forum.freecad.org/viewtopic.php?p=806960) So, this change brings these commands back to the task panel. --- src/Mod/PartDesign/Gui/Workbench.cpp | 91 ++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index 8fbd77b60b..f66d6bc046 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -162,6 +162,19 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Vertex1[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT Part::Feature SUBELEMENT Vertex COUNT 1..", + Vertex1, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* Edge[] = { "PartDesign_Fillet", "PartDesign_Chamfer", @@ -177,6 +190,19 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Edge1[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT Part::Feature SUBELEMENT Edge COUNT 1..", + Edge1, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* Face[] = { "PartDesign_NewSketch", "PartDesign_Fillet", @@ -195,6 +221,19 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Face1[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT Part::Feature SUBELEMENT Face COUNT 1", + Face1, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* Body[] = { "PartDesign_NewSketch", nullptr}; @@ -228,6 +267,7 @@ void Workbench::activated() "Helper Tools", "PartDesign_Body" )); + const char* Plane2[] = { "PartDesign_NewSketch", "Part_DatumPoint", @@ -242,6 +282,32 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Plane3[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT App::Plane COUNT 1", + Plane3, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + + const char* Plane4[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT PartDesign::Plane COUNT 1", + Plane4, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* Line[] = { "Part_DatumPoint", "Part_DatumLine", @@ -254,6 +320,18 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Line1[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT PartDesign::Line COUNT 1", + Line1, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* Point[] = { "Part_DatumPoint", "Part_DatumLine", @@ -267,6 +345,19 @@ void Workbench::activated() "PartDesign_Body" )); + const char* Point1[] = { + "PartDesign_Point", + "PartDesign_Line", + "PartDesign_Plane", + "PartDesign_CoordinateSystem", + nullptr}; + Watcher.push_back(new Gui::TaskView::TaskWatcherCommands( + "SELECT PartDesign::Point COUNT 1", + Point1, + "Datum objects", + "PartDesign_CoordinateSystem" + )); + const char* NoSel[] = { "PartDesign_Body", nullptr};