Tree view: Difference between revisions

From FreeCAD Documentation
(Added the links in the menu command template)
Line 53: Line 53:


For example, with the [[Draft Workbench|Draft Workbench]], first select an object, then right click on an empty place in the tree view:
For example, with the [[Draft Workbench|Draft Workbench]], first select an object, then right click on an empty place in the tree view:
* {{MenuCommand|Toggle visibility}}: calls [[Std_ToggleVisibility|ToggleVisibility]] to make the object visible or invisible in the [[3D view|3D view]].
* {{MenuCommand|[[Std_ToggleVisibility|Toggle visibility]]}}: makes the object visible or invisible in the [[3D view|3D view]].
* {{MenuCommand|Show selection}}: calls [[Std_ShowSelection|ShowSelection]] to make the selected objects visible.
* {{MenuCommand|[[Std_ShowSelection|Show selection]]}}: makes the selected objects visible.
* {{MenuCommand|Hide selection}}: calls [[Std_HideSelection|HideSelection]] to make the selected objects invisible.
* {{MenuCommand|[[Std_HideSelection|Hide selection]]}}: makes the selected objects invisible.
* {{MenuCommand|Toggle selectability}}: calls [[Std_ToggleSelectability|ToggleSelectability]] to make the object no longer selectable in the [[3D view|3D view]]. Use again this command to cancel its effect. It sets the object's {{incode|Selectable}} attribute to {{TRUE}} or {{FALSE}}.
* {{MenuCommand|[[Std_ToggleSelectability|Toggle selectability]]}}: makes the object no longer selectable in the [[3D view|3D view]]. Use again this command to cancel its effect. It sets the object's {{incode|Selectable}} attribute to {{TRUE}} or {{FALSE}}.
* {{MenuCommand|Select all instances}}: calls [[Std_TreeSelectAllInstances|TreeSelectAllInstances]] to select all instances of this object in the tree.
* {{MenuCommand|[[Std_TreeSelectAllInstances|Select all instances]]}}: selects all instances of this object in the tree view.
* {{MenuCommand|Appearance}}: calls [[Std_SetAppearance|SetAppearance]] to launch the dialog to change color and sizes of lines and vertices, and color of faces.
* {{MenuCommand|[[Std_SetAppearance|Appearance]]}}: launches the dialog to change color and sizes of lines and vertices, and color of faces.
* {{MenuCommand|Random color}}: calls [[Std_RandomColor|RandomColor]] to assign a random color to the object. It sets the object's {{incode|ShapeColor}} attribute to a tuple {{incode|(r,g,b)}} with tree random floats between 0 and 1.
* {{MenuCommand|[[Std_RandomColor|Random color]]}}: assigns a random color to the object. It sets the object's {{incode|ShapeColor}} attribute to a tuple {{incode|(r,g,b)}} with tree random floats between 0 and 1.
* {{MenuCommand|Cut}}: disabled if the the right-click is not on the object.
* {{MenuCommand|Cut}}: disabled if the right-click is not on the object.
* {{MenuCommand|Copy}}: calls [[Std_Copy|Copy]] to copy an object to memory.
* {{MenuCommand|[[Std_Copy|Copy]]}}: copies an object into memory.
* {{MenuCommand|Paste}}: calls [[Std_Paste|Paste]] to paste a new object into the document; the copy is added to the end of the tree view.
* {{MenuCommand|[[Std_Paste|Paste]]}}: pastes the copied object into the document; the copy is added to the end of the tree view.
* {{MenuCommand|Delete}}: calls [[Std_Delete|Delete]] to removes the object from the document, and from the tree view.
* {{MenuCommand|[[Std_Delete|Delete]]}}: removes the object from the document, and from the tree view by calling the document's {{incode|removeObject()}} method.
* {{MenuCommand|Utilities}}: utilities specific to the [[Draft Workbench|Draft Workbench]].
* {{MenuCommand|Utilities}}: utilities specific to the [[Draft Workbench|Draft Workbench]].



Revision as of 02:35, 27 September 2019

Introduction

The tree view appears in the Model tab of the combo view; 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.

The tree view showing various elements in the document.

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 which also depends on 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.

The topmost object is created by doing parametric operations on objects which themselves were created by previous operations. Expanding the tree many levels reveals the original elements that were used to create the partial solids.

Actions

Note: 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 that can be executed from the context menu in 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:

  • Expression actions: 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:

  • Expression actions: Copy active document, Copy all documents.

In addition, Link actions are available.

Once objects are added to the document then in addition to the previous menus, right clicking on an empty part of the tree view will show additional options. These depend on the type of object and the active workbench.

For example, with the Draft Workbench, first select an object, then right click on an empty place in the tree view:

  • Toggle visibility: makes the object visible or invisible in the 3D view.
  • Show selection: makes the selected objects visible.
  • Hide selection: makes the selected objects invisible.
  • Toggle selectability: makes the object no longer selectable in the 3D view. Use again this command to cancel its effect. It sets the object's Selectable attribute to true or false.
  • Select all instances: selects all instances of this object in the tree view.
  • Appearance: launches the dialog to change color and sizes of lines and vertices, and color of faces.
  • Random color: assigns a random color to the object. It sets the object's ShapeColor attribute to a tuple (r,g,b) with tree random floats between 0 and 1.
  • Cut: disabled if the right-click is not on the object.
  • Copy: copies an object into memory.
  • Paste: pastes the copied object into the document; the copy is added to the end of the tree view.
  • Delete: removes the object from the document, and from the tree view by calling the document's removeObject() method.
  • Utilities: utilities specific to the Draft Workbench.


Template:Interface