diff --git a/src/Base/VectorPy.xml b/src/Base/VectorPy.xml
index 6286e4b27..81cd9b005 100644
--- a/src/Base/VectorPy.xml
+++ b/src/Base/VectorPy.xml
@@ -88,6 +88,14 @@
+
+
+
+ distanceToPoint(Vector)
+ returns the distance to another point
+
+
+
distanceToLine(Vector,Vector)
diff --git a/src/Base/VectorPyImp.cpp b/src/Base/VectorPyImp.cpp
index 4a1bae849..830ec386e 100644
--- a/src/Base/VectorPyImp.cpp
+++ b/src/Base/VectorPyImp.cpp
@@ -380,6 +380,20 @@ PyObject* VectorPy::projectToPlane(PyObject *args)
return Py::new_reference_to(this);
}
+PyObject* VectorPy::distanceToPoint(PyObject *args)
+{
+ PyObject *pnt;
+ if (!PyArg_ParseTuple(args, "O!",&(VectorPy::Type),&pnt))
+ return 0;
+
+ VectorPy* base_vec = static_cast(pnt);
+ VectorPy::PointerType this_ptr = reinterpret_cast(_pcTwinPointer);
+ VectorPy::PointerType base_ptr = reinterpret_cast(base_vec->_pcTwinPointer);
+
+ Py::Float dist(Base::Distance(*this_ptr, *base_ptr));
+ return Py::new_reference_to(dist);
+}
+
PyObject* VectorPy::distanceToLine(PyObject *args)
{
PyObject *base, *line;