Enable Python to read the value of a sketcher constraint

This commit is contained in:
jrheinlaender 2013-09-13 19:35:36 +02:00 committed by Stefan Tröger
parent f6958f391c
commit 45ce3b7822
2 changed files with 12 additions and 1 deletions

View File

@ -14,7 +14,7 @@
<Documentation>
<Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
<UserDocu>With this objects you can handle sketches</UserDocu>
<UserDocu>With this object you can handle sketches</UserDocu>
</Documentation>
<Attribute Name="First" ReadOnly="false">
<Documentation>
@ -28,6 +28,12 @@
</Documentation>
<Parameter Name="Second" Type="Int"/>
</Attribute>
<Attribute Name="Value" ReadOnly="true">
<Documentation>
<UserDocu>Value of the Constraint</UserDocu>
</Documentation>
<Parameter Name="Value" Type="Float"/>
</Attribute>
<Attribute Name="Name" ReadOnly="false">
<Documentation>
<UserDocu>Name of the constraint</UserDocu>

View File

@ -503,6 +503,11 @@ void ConstraintPy::setName(Py::String arg)
this->getConstraintPtr()->Name = arg;
}
Py::Float ConstraintPy::getValue(void) const
{
return Py::Float(this->getConstraintPtr()->getValue());
}
PyObject *ConstraintPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;