From 2d3293306bced149ccba55067f8bb85771667237 Mon Sep 17 00:00:00 2001 From: joha2 Date: Sun, 2 Apr 2023 19:29:13 +0200 Subject: [PATCH] Points: `show` now returns an `GeoFeature` object * Added one return statement into try-catch block which returns the appropriate object (instead of `None`). * Behaviour now in line with `Part.show`. Example: ```Python >>> import Points >>> pp = Points.Points() >>> pp.addPoints([(1,2,3),(4,5,6)]) >>> go = Points.show(pp) >>> go # Former behaviour was to return None >>> go.ViewObject.ShapeColor = (1,0,0) >>> go.ViewObject.ShapeColor = (1.,0.,0.) >>> go.ViewObject.PointSize = 20 ``` --- src/Mod/Points/App/AppPointsPy.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Mod/Points/App/AppPointsPy.cpp b/src/Mod/Points/App/AppPointsPy.cpp index 49481866f8..5db820f5b1 100644 --- a/src/Mod/Points/App/AppPointsPy.cpp +++ b/src/Mod/Points/App/AppPointsPy.cpp @@ -398,6 +398,7 @@ private: Points::Feature* pcFeature = static_cast(pcDoc->addObject("Points::Feature", name)); // copy the data pcFeature->Points.setValue(*(pPoints->getPointKernelPtr())); + return Py::asObject(pcFeature->getPyObject()); } catch (const Base::Exception& e) { throw Py::RuntimeError(e.what());