From a161df7ad39b6165c9146efaea0ec02786937b85 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Wed, 26 Jun 2024 18:04:36 +0200 Subject: [PATCH] Measure: Pass last object in subobject list to getTopoShape --- src/Mod/Part/App/MeasureClient.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mod/Part/App/MeasureClient.cpp b/src/Mod/Part/App/MeasureClient.cpp index b2f514ace0..5621a88691 100644 --- a/src/Mod/Part/App/MeasureClient.cpp +++ b/src/Mod/Part/App/MeasureClient.cpp @@ -91,11 +91,12 @@ static float getRadius(TopoDS_Shape& edge){ TopoDS_Shape getLocatedShape(const App::SubObjectT& subject) { - App::DocumentObject* obj = subject.getObject(); + App::DocumentObject* obj = subject.getSubObjectList().back(); if (!obj) { return {}; } - Part::TopoShape shape = Part::Feature::getTopoShape(obj); + + Part::TopoShape shape = Part::Feature::getTopoShape(obj, subject.getElementName()); if (shape.isNull()) { return {}; } @@ -314,7 +315,7 @@ MeasureAreaInfoPtr MeasureAreaHandler(const App::SubObjectT& subject) if (shape.IsNull()) { // failure here on loading document with existing measurement. - Base::Console().Message("MeasureLengthHandler did not retrieve shape for %s, %s\n", + Base::Console().Message("MeasureAreaHandler did not retrieve shape for %s, %s\n", subject.getObjectName(), subject.getElementName()); return std::make_shared(false, 0.0, Base::Matrix4D()); }