+ # Create auxiliary diagonals in case of centered rectangle
+ if self.string(self.RECTANGLE_TYPE_ID()).value() == self.RECTANGLE_CENTERED_ID():
+ aDiag1 = self.__sketch.addFeature("SketchLine")
+ aLinesList.append(aDiag1)
+ aDiag2 = self.__sketch.addFeature("SketchLine")
+ aLinesList.append(aDiag2)
+ # coincidences in corners
+ aPoints = [aDiag1.attribute("StartPoint"), aDiag2.attribute("StartPoint"),
+ aDiag1.attribute("EndPoint"), aDiag2.attribute("EndPoint")]
+ for i in range (0, len(aPoints)):
+ aCoincidence = self.__sketch.addFeature("SketchConstraintCoincidence")
+ aRefAttrA = aCoincidence.refattr("ConstraintEntityA")
+ aRefAttrB = aCoincidence.refattr("ConstraintEntityB")
+ aRefAttrA.setAttr(aStartPoints[i])
+ aRefAttrB.setAttr(aPoints[i])
+ # Update coordinates of created lines
+ self.updateLines()
+ aDiag1.execute()
+ aDiag2.execute()
+ # coincidences between center point and diagonals
+ refPnt = self.getReferencePoint(self.refattr(self.CENTER_REF_ID()))
+ if refPnt is not None:
+ for line in [aDiag1.lastResult(), aDiag2.lastResult()]:
+ aCoincidence = self.__sketch.addFeature("SketchConstraintCoincidence")
+ aCoincidence.refattr("ConstraintEntityA").setAttr(refPnt)
+ aCoincidence.refattr("ConstraintEntityB").setObject(line)