ToggleActiveConstraint allows you to activate and deactivate an already placed constraint. This allows you to keep the constraint in the background but temporarily test another arrangement of the existing geometry.
The Toggle driving constraint tool is similar in that it disables the effect of the constraint; however, with this tool, the constraint does not keep its old value. On the other hand, with ToggleActiveConstraint you can re-activate the old constraint immediately.
- Select an already placed constraint, then press ToggleActiveConstraint.
- Alternatively, got to the task panel, to the Constraints section, select the constraint, then open the context menu (right-click), and select Deactivate.
- To activate the constraint again, select it, and press ToggleActiveConstraint again.
Fully constrained sketch.
Left: deactivated constraint; the sketch is no longer fully constrained. Right: the unconstrained geometry can be moved around; the older constraint is still available, and can be re-activated to return to the fully constrained sketch.
Task panel with the deactivated constraint.
See also: FreeCAD Scripting Basics.
The active status of a constraint can be controlled in macros and from the Python console.
toggleActive method of an existing Sketcher SketchObject, and the
index of the constraint to activate it or deactivate it. The index starts from
0 all the way to
N is the total number of constraints.
import FreeCAD as App
sketch = App.ActiveDocument.Sketch
- Sketcher geometries: Point, Line by 2 point, Create an arc, Arc, Arc by 3 Point, Create a circle, Circle, Circle by 3 Point, Create a conic, Ellipse by center, Ellipse by 3 points, Arc of ellipse, Arc of hyperbola, Arc of parabola, Create a B-spline, Create B-spline, Create periodic B-pline, Polyline (multiple-point line), Rectangle, Create regular polygon, Triangle, Square, Pentagon, Hexagon, Heptagon, Octagon, Create Regular Polygon, Slot, Fillet, Trimming, Extend, External Geometry, CarbonCopy, Construction Mode
- Sketcher constraints
- Geometric constraints Coincident, Point On Object, Vertical, Horizontal, Parallel, Perpendicular, Tangent, Equal Length, Symmetric, Constrain Block
- Dimensional constraints Lock, Horizontal Distance, Vertical Distance, Distance, Radius, Internal Angle, Snell's Law, Internal Alignment, Toggle reference/driving constraint,
- Sketcher tools Select solver DOFs, Close Shape, Connect Edges, Select Constraints, Select Origin, Select Vertical Axis, Select Horizontal Axis, Select Redundant Constraints, Select Conflicting Constraints, Select Elements Associated with constraints, Show/Hide internal geometry, Symmetry, Clone, Copy, Move, Rectangular Array, Delete All Geometry, Delete All Constraints
- Installation: Linux/Unix, Windows, Mac, Docker, AppImage; Getting started
- Basics: About FreeCAD, Workbenches, Preferences, Document structure, Interface Customization, Properties, Mouse Model; Tutorials, Video tutorials
- Workbenches: Std Base; Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Plot, Points, Raytracing, Reverse Engineering, Robot, Ship, Sketcher, Spreadsheet, Start, Surface workbench, TechDraw, Test Framework, Web
- Scripting: Introduction to Python, FreeCAD scripting tutorial, FreeCAD Scripting Basics, How to install macros, Gui Command, Units Modules: Builtin modules, Workbench creation, Installing more workbenches Meshes: Mesh Scripting, Mesh Module Parts: The Part Module, Topological data scripting, PythonOCC, Mesh to Part Coin scenegraph: The Coin/Inventor scenegraph, Pivy Qt interface: PySide, Using the FreeCAD GUI, Dialog creation Parametric objects: Scripted objects Other: Code snippets, Line drawing function, Embedding FreeCAD, FreeCAD vector math library, Power users hub, Python, Macros, FreeCAD Scripting Basics, Topological data scripting