January 13, 2026

Career Flyes

Fly With Success

How to Lock an Item in the Model Tree in FreeCAD

4 min read

In FreeCAD, managing and organizing complex designs within the model tree can sometimes become overwhelming, especially when working on multi-body objects or assembling detailed mechanisms. One incredibly useful technique for managing this complexity is “locking” items in the model tree—preventing accidental edits, ensuring consistency, and improving overall workflow. This article explores the concept of locking items in FreeCAD’s model tree and offers several approaches to emulate this feature, considering FreeCAD doesn’t include a direct “lock” button like some other CAD tools.

TL;DR

FreeCAD does not currently offer a direct way to “lock” objects in the model tree with a single click. However, there are effective workarounds such as using visibility settings, moving items to different groups, or leveraging the Part container to “freeze” geometry. You can also make use of custom properties, document levels, and external references to simulate object locking. These techniques significantly reduce the chances of accidental modifications and improve your project workflow in FreeCAD.

Understanding the Model Tree in FreeCAD

The model tree, located typically on the left side of the FreeCAD interface, is a hierarchical representation of all objects, components, and operations in your project. It reflects the real-time construction sequence and structure of your 3D model. By interacting with items in the model tree, users can modify geometry, transform bodies, or update parameters.

Unlike standard folders on your computer, items in the model tree are interdependent and parametric. This means that changes made to a parent or a child object in the tree can cascade through the model. Therefore, “locking” is not just about accessibility—it’s a mechanism to maintain design intent and integrity.

Why Lock Items?

Here are some common reasons why users may want to lock items:

  • Prevent Accidental Edits: Avoid altering reference geometries that have already been finalized.
  • Reduce Clutter: Declutter your workspace by hiding or grouping finalized components.
  • Protect Dependencies: Ensure driven features aren’t broken due to upstream changes.
  • Improve Workflow: Create a stable baseline before experimenting with new features.

Methods to “Lock” an Item in the Model Tree

Since FreeCAD does not offer native object locking, you can apply the following techniques to simulate that functionality.

1. Using Visibility Control

Sometimes the easiest solution is hiding the object entirely from view:

  1. Select the object in the model tree.
  2. Press the spacebar to toggle visibility.

While this doesn’t prevent edits directly, a hidden object is far less likely to be clicked unintentionally. For finalized parts that will remain static, hiding them can create a pseudo-locking mechanism.

Tip: Use the “Select Visible Objects” macro to quickly show or hide multiple objects at once.

2. Placing in a Group or Part Container

FreeCAD’s Part workbench allows users to create containers that house multiple objects. When grouped this way, hierarchical control can be applied:

  1. Go to the Part workbench.
  2. Create a Part container.
  3. Drag finalized objects into the Part container.
  4. Collapse the container and optionally hide it.

Additionally, you can lock transformations via the Placement property. By hardcoding placement values and being cautious not to click the container, you gain an added layer of protection.

3. Switching to Read-Only Mode

Another effective method is saving your FreeCAD file and then reopening it in a read-only state. This approach locks the entire document, making no object editable unless you reopen it in write mode.

To do this:

  1. Close the current file.
  2. Right-click the file in your operating system file manager.
  3. Select Properties → Check Read-only.
  4. Open again in FreeCAD.

This technique is particularly useful when transitioning from a modeling phase to detailing and documentation.

4. Using the Draft Workbench “Freeze” Concept

In the Draft workbench, objects like wires, lines, and shapes can be made “non-parametric,” effectively freezing them. To convert a parametric object:

  1. Select a Draft object.
  2. Use the option Draft to Sketch or Upgrade/Downgrade to strip parametric history.

This makes the object immune to dependency changes. It is not reversible, so use it only when you’re confident the item is final.

5. Locking Parameters Using Expressions

In the Data tab of most objects, dimensions and properties can be set via expressions. You can lock these values or tie them to constants using:

  • User parameters under the Tools → Edit Parameters menu.
  • Spreadsheet constraints for centralized control.

An advantage of this method is that even if someone tries editing values manually, FreeCAD will revert them according to the expression rules.

Bonus: Macro for Item Locking

FreeCAD’s extended Python API allows you to write custom macros that can emulate locking behavior. Here’s a simple example:

for obj in App.ActiveDocument.Objects:
    obj.ViewObject.Visibility = False

This macro hides all objects in the model tree. More advanced scripts can disable editing by restricting placement or parameter changes programmatically.

Things to Watch Out For

Even when using these techniques, be aware of risks:

  • Undo/Redo cycles can overwrite visibility changes. Always save your file before making sweeping changes.
  • Bugs related to Dependency Graphs may create unwanted loops. You can view dependency graphs using the Dependency Viewer.
  • Over-hiding or over-grouping can lead to losing track of object purpose. Keep names descriptive and use colors when necessary.

Future of Locking in FreeCAD

The FreeCAD community has long discussed adding item-level locking features to natively prevent edits. As of now, developers suggest using best practices like the ones described in this article. However, plugins and add-ons in future releases may offer a GUI-level solution.

Conclusion

Although FreeCAD doesn’t include a built-in lock feature for objects in the model tree, several workarounds can effectively simulate this behavior. Whether you’re dimming visibility, encapsulating final geometries into containers, or using scripting methods, these practices can greatly improve model integrity and workflow stability.

As FreeCAD evolves, user creativity and community contributions continue to fill in the gaps. Until an official locking tool is implemented, take advantage of the flexibility FreeCAD offers and craft a method that best suits your modeling habits.