From c809bfbed807085f359c3514a76f8d4fe44fdfd0 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 23 Jan 2017 23:28:22 +0100 Subject: [PATCH] Sketcher: InternalAligment Python extension to InternalAlignmentIndex ===================================================================== Extension of Constraint Python code to consider the case with 4 ints, where the last int is InternalAligmentIndex for InternalAligment constraint --- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index a7d9809566..fb944a1538 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -290,6 +290,28 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) this->getConstraintPtr()->ThirdPos = (Sketcher::PointPos) intArg4; return 0; } + else if (strstr(ConstraintType,"InternalAlignment") != NULL) { // InteralAlignment with InternalElementIndex argument + this->getConstraintPtr()->Type = InternalAlignment; + + valid = true; + + if(strstr(ConstraintType,"BSplineControlPoint") != NULL) { + this->getConstraintPtr()->AlignmentType=BSplineControlPoint; + } + else { + this->getConstraintPtr()->AlignmentType=Undef; + valid = false; + } + + if (valid) { + this->getConstraintPtr()->First = intArg1; + this->getConstraintPtr()->FirstPos = (Sketcher::PointPos) intArg2; + this->getConstraintPtr()->Second = intArg3; + this->getConstraintPtr()->InternalAlignmentIndex = intArg4; + return 0; + } + + } if (valid) { this->getConstraintPtr()->First = intArg1; this->getConstraintPtr()->FirstPos = (Sketcher::PointPos) intArg2;