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.
This commit is contained in:
wmayer
2025-01-27 10:21:32 +01:00
committed by Ladislav Michl
parent ab60695ef9
commit 20a4dc3839

View File

@@ -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};