Delete All Sketch Constraints in FreeCAD
Removing constraints one by one in FreeCAD can be tedious and time-consuming, especially in complex geometry. This guide explains how to quickly select and delete every constraint in an active sketch simultaneously using the built-in Sketcher tools in the graphical interface, as well as an alternative method using the Python console.
Method 1: Using the Constraints List (GUI)
The fastest way to remove all constraints without touching your geometry is through the Tasks panel.
- Enter Sketch Edit Mode: Double-click your sketch in the Tree view to open it in the Sketcher workbench.
- Locate the Constraints List: In the Combo View panel on the left, navigate to the Tasks tab. Expand the Constraints section to reveal the list of all applied constraints (coincident, horizontal, dimensions, etc.).
- Select All Constraints:
- Click the first constraint at the top of the list.
- Scroll down to the bottom.
- Hold the
Shiftkey and click the last constraint in the list. All constraints will now be highlighted. - (Alternatively, in newer FreeCAD versions, click inside the list
and press
Ctrl + A).
- Delete: Press the
Deletekey on your keyboard.
All constraints will immediately be removed, leaving your sketch geometry intact as unconstrained, free-floating elements.
Method 2: Box Selecting in the 3D View
If you want to clear constraints directly from the viewport:
- In the open sketch, switch the selection filter to select constraints, or simply ensure no other command is active.
- Drag a selection box over your entire drawing area to select all visible geometry and constraints.
- In the Tasks panel under the Constraints list, observe that all corresponding constraints are highlighted.
- Press
Delete. (Note: Be careful not to delete underlying lines or arcs; if lines are deleted, undo withCtrl + Zand use Method 1 instead).
Method 3: Using the Python Console
If your sketch is extremely large or the interface becomes unresponsive, you can clear them programmatically.
- Open the Python Console via View > Panels > Python console.
- With the target sketch open, run the following code:
sketch = App.ActiveDocument.ActiveObject
while sketch.ConstraintCount > 0:
sketch.delConstraint(0)
App.ActiveDocument.recompute()This script repeatedly removes the first constraint until the total constraint count reaches zero and recomputes the document cleanly.