Tree view/ko

Introduction
The tree view appears in the tab of the combo view, one of the most important panels in the interface; it shows all user defined objects that are part of a FreeCAD document. The tree view is a representation of the document's structure, and indicates what information is saved to disk.

These objects don't necessarily have to be geometrical shapes visible in the 3D view, but can also be supporting data objects created with any of the workbenches.



Working with the tree view
By default, whenever a new object is created, it is added to the end of the list in the tree view. The tree view allows managing the objects to keep them organized; it permits creating groups, moving objects inside groups, moving groups inside other groups, renaming objects, copying objects, deleting objects, and other operations in the contextual menu (right click) which depend on the currently selected object and the currently active workbench.

Many operations create objects that are dependent on a previously existing object. In this case, the tree view shows this relationship by absorbing the older object inside the new object. Expanding and collapsing the objects in the tree view shows the parametric history of that object. Objects that are deeper inside others are older, while objects that are outside are newer, and are derived from the older objects. By modifying the interior objects, the parametric operations propagate all the way to the top, generating a new result.





Actions
expressions and link actions were added in version 0.19.

Since the tree view lists objects that may be visible in the 3D view, many of the actions are the same to those that can be executed from the 3D view.

When the application starts, the default Start Workbench is active, and no document has been created, right clicking on the tree view shows only one command:
 * : Copy selected, Copy active document, Copy all documents, Paste. These allow working with various documents, but are disabled if no document is present.

Once a new document has been created the following become active:
 * : Copy active document, Copy all documents.

In addition, Link actions are available.
 * : Make Link.
 * : Simple group, Group with links, Group with transform links.

Selecting the document
If you select the active document and right click, in addition to and, the following commands appear:
 * : if active, the tree view will show hidden items.
 * : shows an input field to search objects inside the selected document.
 * : closes the selected document by calling the application's method.
 * : if active, the document's objects will not recompute automatically.
 * : if active, the document will allow recompute of only some objects.
 * : marks all objects of the document as touched, and ready for recompute.
 * : creates a group in the selected document by using the document's method.

Selecting objects
Once objects are added to the document then in addition to the previous actions, right clicking on an empty part of the tree view will show additional commands; these depend on the type of object and the active workbench.

For example, with the Draft Workbench active, first select an object, then right click on an empty place in the tree view:
 * : makes the object visible or invisible in the 3D view.
 * : makes the selected objects visible.
 * : makes the selected objects invisible.
 * : makes the object no longer selectable in the 3D view; use again this command to cancel its effect. It sets the object's attribute to  or . Change the property by toggling  in the property editor.
 * : selects all instances of this object in the tree view.
 * : launches the dialog to change color and sizes of lines and vertices, and color of faces.
 * : assigns a random color to the object. It sets the object's attribute to a tuple  with tree random floats between 0 and 1. Change the property by modifying  in the property editor.
 * : disabled if the right-click is not on the object.
 * : copies an object into memory.
 * : pastes the copied object into the document; the copy is added to the end of the tree view.
 * : removes the object from the document, and from the tree view, by calling the document's method.
 * : additional contextual commands provided by the Draft Workbench.

If an object is selected, for example, a Draft Line, and a right click is made in the same object additional commands may be available:
 * : launches the transform widget to move or rotate the object.
 * : sets the colors of the object.
 * : specific command for a Draft Line.
 * : if active, the selected object will be set as hidden.
 * : marks the selected object as touched, and ready for recompute.
 * : recomputes the selected object.
 * : starts editing the name of the selected object. This allows changing the attribute, but not the  attribute, as the latter is read-only.

Overlay icons
The icons in the tree view can have different overlays, which means that another even smaller icon is put on top of the tree view icon.
 * [[File:FreeCAD_Tree_view_recompute.png]] White hook on blue background: This object has to be recomputed, due to changes made to the model or because the user marked the object in the context menu to be recomputed. In most cases the recompute is triggered automatically, but sometimes the recomputes are delayed due to performance reasons. You then have to Recompute manually.
 * [[File:FreeCAD_Tree_view_tip.png]] White arrow on green background: This is the so called Tip of a body. It is usually the last feature in a PartDesign Body and represents the whole body to the world outside of the body, e.g. when the body is exported or used in Part boolean operations. The tip can be changed by the user.
 * [[File:FreeCAD_Tree_view_unattached.png]] Purple chain link on white background: This is usually shown for sketches, geometric primitives, such as cube, cylinder, etc. or Datum geometry and indicates, that the object is not attached to anything. It has no AttachmentOffset and gets its position and alignement solely from its Placement property. There is a Basic Attachment Tutorial explaining how to handle such objects.
 * [[File:FreeCAD_Tree_view_notfullyconstrained.png]] Yellow X: The sketch is not fully constrained. Inside of Sketcher the number of remaining degrees of freedom is shown in the solver messages.
 * [[File:FreeCAD_Tree_view_error.png]] White exclamation mark on red background: An error occurred and has to be removed. If you recompute the whole document a tooltip describing the error is shown when you hover with the mouse over that error. Note: All other objects depending on an object in such error state are not recomputed either, thus they may still show some old state.
 * It is possible that multiple overlays are shown at the same time, example: [[File:FreeCAD_Tree_view_multiple.png]]