From 694aefc19725fffe2c8c74b799c1bc25019d748e Mon Sep 17 00:00:00 2001 From: wandererfan Date: Thu, 3 Nov 2022 19:27:13 -0400 Subject: [PATCH] [Measurement]apply globalPlacement to geometry --- src/Mod/Measure/App/Measurement.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Measure/App/Measurement.cpp b/src/Mod/Measure/App/Measurement.cpp index 931b8aa311..ccdc6a5473 100644 --- a/src/Mod/Measure/App/Measurement.cpp +++ b/src/Mod/Measure/App/Measurement.cpp @@ -195,9 +195,14 @@ MeasureType Measurement::getType() TopoDS_Shape Measurement::getShape(App::DocumentObject *obj , const char *subName) const { try { - auto shape = Part::Feature::getShape(obj,subName,true); + Part::TopoShape partShape = Part::Feature::getTopoShape(obj); + App::GeoFeature* geoFeat = dynamic_cast(obj); + if (geoFeat) { + partShape.setPlacement(geoFeat->globalPlacement()); + } + TopoDS_Shape shape = partShape.getSubShape(subName); if(shape.IsNull()) - throw Part::NullShapeException("null shape"); + throw Part::NullShapeException("null shape in measurement"); return shape; } catch (Standard_Failure& e) { throw Base::CADKernelError(e.GetMessageString());