--- /dev/null
+import unittest
+import model
+from TestSketcher import SketcherTestCase
+
+class SketcherSetRigid(SketcherTestCase):
+ def runTest(self):
+ circle = self.sketch.addCircle(0, 10, 20)
+ self.sketch.setRigid(circle.result())
+ model.do()
+ with self.assertRaises(Exception):
+ circle.setCenter(0, 0)
+ model.do()
+
+if __name__ == "__main__":
+ unittest.main(verbosity=2)
\ No newline at end of file
constraint.data().refattr("ConstraintEntityA").setObject(line_1)
constraint.data().reflist("ConstraintEntityB").clear
constraint.data().reflist("ConstraintEntityB").append(line_1)
-
+ self.execute()
+ return constraint
+
+ def setRigid(self, object_):
+ """Set a rigid constraint on a given object."""
+ constraint = self._feature.addFeature("SketchConstraintRigid")
+ constraint.data().refattr("ConstraintEntityA").setObject(object_)
self.execute()
return constraint