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.

  1. Enter Sketch Edit Mode: Double-click your sketch in the Tree view to open it in the Sketcher workbench.
  2. 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.).
  3. Select All Constraints:
    • Click the first constraint at the top of the list.
    • Scroll down to the bottom.
    • Hold the Shift key 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).
  4. Delete: Press the Delete key 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:

  1. In the open sketch, switch the selection filter to select constraints, or simply ensure no other command is active.
  2. Drag a selection box over your entire drawing area to select all visible geometry and constraints.
  3. In the Tasks panel under the Constraints list, observe that all corresponding constraints are highlighted.
  4. Press Delete. (Note: Be careful not to delete underlying lines or arcs; if lines are deleted, undo with Ctrl + Z and 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.

  1. Open the Python Console via View > Panels > Python console.
  2. 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.