Manage Sketch Visibility in Large FreeCAD Models
Managing sketch visibility in complex FreeCAD projects is critical for maintaining viewport performance and reducing visual clutter. As assemblies and parts scale up, hundreds of overlapping geometric constraints and construction lines can slow down rendering and make model navigation difficult. This guide outlines practical methods to control sketch visibility efficiently, including built-in display preferences, tree view management, selection filters, and quick Python commands to hide all sketches instantly.
Enable Automatic Sketch Hiding
FreeCAD can automatically hide a sketch as soon as a 3D feature (such as a Pad, Pocket, or Revolution) is generated from it. To ensure this behavior is active:
- Navigate to Edit > Preferences.
- Select Part Design from the left panel and click the Shape View tab.
- Check the option labeled Hide sketch after creating a feature.
- Click Apply and OK.
This setting prevents older sketches from lingering in the 3D viewport as your model evolves.
Master Keyboard and Tree View Controls
The fastest way to toggle visibility manually is directly within the tree view:
- The Spacebar Shortcut: Click any sketch or feature
in the tree view and press
Spaceto toggle visibility on or off. - Batch Selection: Hold
Ctrlto select specific sketches, or holdShiftto select a continuous range of sketches in the tree view, then pressSpaceto toggle all selected items simultaneously. - Parent Object Propagation: Toggling the visibility of a parent object (such as a Body or Part container) can hide all nested elements at once, allowing you to focus on the active component.
Organize with Groups and Parts
For large models with multiple sub-assemblies, utilize Std Group or App::Part containers to keep your tree structured. Grouping sketches by operation or sub-assembly allows you to collapse tree nodes, preventing visual confusion. When you need to isolate your view, you can hide an entire group with a single press of the spacebar without altering the visibility of individual finished solid bodies.
Hide All Sketches with a Python One-Liner
When opening a complex model where multiple sketches are exposed, hiding them one by one through the interface can be tedious. You can instantly hide every sketch in your active document using the built-in Python console.
- Open the console via View > Panels > Python console if it is not already visible.
- Paste the following line and press
Enter:
for obj in App.ActiveDocument.Objects:
if obj.isDerivedFrom("Sketcher::SketchObject"):
obj.Visibility = False- To refresh the 3D viewport, run:
App.ActiveDocument.recompute()You can save this script as a macro via Macro > Macros... > Create and assign it to a custom toolbar button or keyboard shortcut for one-click cleanup across any project.
Utilize the Dependency Graph
If you need to identify which sketch belongs to which feature without making everything visible in the 3D view, navigate to Tools > Dependency graph. This visual representation lets you trace relationships between sketches, datum geometry, and solid operations without cluttering your main workspace.