diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index fe694e1b7..74bbc6646 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -594,6 +594,18 @@ void PropertyPlacement::setPathValue(const ObjectIdentifier &path, const boost:: Property::setPathValue(path, value); } +const boost::any PropertyPlacement::getPathValue(const ObjectIdentifier &path) const +{ + std::string p = path.getSubPathStr(); + + if (p == ".Base.x" || p == ".Base.y" || p == ".Base.z") { + // Convert double to quantity + return Base::Quantity(boost::any_cast(Property::getPathValue(path)), Unit::Length); + } + else + return Property::getPathValue(path); +} + PyObject *PropertyPlacement::getPyObject(void) { return new Base::PlacementPy(new Base::Placement(_cPos)); diff --git a/src/App/PropertyGeo.h b/src/App/PropertyGeo.h index 4691b2d20..a9a67fc24 100644 --- a/src/App/PropertyGeo.h +++ b/src/App/PropertyGeo.h @@ -265,6 +265,8 @@ public: void setPathValue(const ObjectIdentifier &path, const boost::any &value); + const boost::any getPathValue(const ObjectIdentifier &path) const; + const char* getEditorName(void) const { return "Gui::PropertyEditor::PropertyPlacementItem"; }