From 5a58c5a084bed11e1de98dafe3f52f9cda774b9f Mon Sep 17 00:00:00 2001 From: bdieterm Date: Sat, 12 Aug 2023 19:05:00 +0200 Subject: [PATCH] ignore whole selected objects for Part linear/angular measurement tool Whole objects selected in the model tree will be ignored for the measurement element selection. This allows for selecting and toggling the visibility of an object in the model tree. --- src/Mod/Part/Gui/TaskDimension.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Part/Gui/TaskDimension.cpp b/src/Mod/Part/Gui/TaskDimension.cpp index ece7bd274d..25ae208afb 100644 --- a/src/Mod/Part/Gui/TaskDimension.cpp +++ b/src/Mod/Part/Gui/TaskDimension.cpp @@ -560,6 +560,9 @@ PartGui::TaskMeasureLinear::~TaskMeasureLinear() void PartGui::TaskMeasureLinear::onSelectionChanged(const Gui::SelectionChanges& msg) { + if (msg.pSubName[0] == '\0') + return; // ignore whole objects selected in the model tree, e.g. when toggling the visibility of an object + if (buttonSelectedIndex == 0) { if (msg.Type == Gui::SelectionChanges::AddSelection) @@ -1557,6 +1560,9 @@ PartGui::TaskMeasureAngular::~TaskMeasureAngular() void PartGui::TaskMeasureAngular::onSelectionChanged(const Gui::SelectionChanges& msg) { + if (msg.pSubName[0] == '\0') + return; // ignore whole objects selected in the model tree, e.g. when toggling the visibility of an object + TopoDS_Shape shape; Base::Matrix4D mat; if (!getShapeFromStrings(shape, std::string(msg.pDocName),