Selection methods: Difference between revisions

From FreeCAD Documentation
(New page consolidates all selection documentation and adds missing information.)
 
(Rewritten with more information, links and templates.)
Line 1: Line 1:
<languages/>
<translate>

{{docnav
{{docnav
|[[Mouse_Model|Mouse navigation]]
|[[Mouse_Model|Mouse navigation]]
Line 4: Line 7:
}}
}}


FreeCAD provides many mouse and/or keyboard '''selection methods''' in the 3D space and also in the [[Tree_view#Selecting_Objects|Model Tree view-Selecting Objects]] and Task panes as well as other selection specific panes and dialogs. Some selection methods are work bench specific and are documented in the work bench.
[[Selection_methods|Selection methods]] in FreeCAD allow picking objects in the [[3D_view|3D view]], [[Tree_view|tree view]], [[Selection_view|selection view]], and other dialogs. Some selection methods are workbench specific and are documented in the particular workbench documentation.


==Simple selection==
== 3D view ==


In the [[3D_view|3D view]] there are various ways of selecting objects using the mouse pointer.
Simple left mouse click selection and hover Preselection are described in previous section [[Mouse_Model#Selecting_objects|Mouse Model - Selecting objects]]


===Simple selection===
==3D view repeated clicks==


Simple selection with the mouse (by default left-click) and pre-selection (hover) are described in the [[Mouse_Model|mouse navigation]] page.
First click selects face/edge/vertex under the mouse. Second click selects the whole object. {{Version|0.18}}


===Repeated clicks===
Third click extends selection to its container (Part, Body, other). Further clicks expand selection up the containment chain. {{Version|0.19}}


The first click selects a sub-element (vertex, edge or face) of the object under the mouse. A second click selects the whole object. {{Version|0.18}}
==Select All, Box and Box element selection==


The third click extends the selection to its container object ([[PartDesign_Body|PartDesign Body]], [[Std_Part|Std Part]], and others). Further clicks expand the selection up the container chain. {{Version|0.19}}
Advanced mouse drag selection features for bulk selection of vertexes or faces are available using [[Std_SelectAll|Std SelectAll]], [[Std_BoxSelection|Box Selection]] and [[Std_BoxElementSelection|Box Element Selection]].


===Selection commands===
The Box selection modes revert to the default [[Std_SelectAll|Std SelectAll]], after any selection.


Mouse drag selection to select multiple objects or sub-elements (vertices or faces) is available using [[Std_SelectAll|Std SelectAll]], [[Std_BoxSelection|Std BoxSelection]], [[Part_BoxSelection|Part BoxSelection]], and [[Std_BoxElementSelection|Std BoxElementSelection]].
==Selection View Panel==
The [[Selection_view|Selection View Panel]] shows more information about all currently selected objects and provides many additional selection features.


The Box selection modes revert to the default [[Std_SelectAll|Std SelectAll]], after any selection. (What does this mean??)
==Object Selection Export==
In report view pane, highlight any text, then using keyboard ctl+c opens the '''Object selection dialog'''. Note right click, then selecting copy does not open the dialog.


==Selection view==
This allows selection of desired objects (Features?) to export, ie paste somewhere else in your FreeCAD document.


The [[Selection_view|selection view]] shows the names of the objects being selected, including their full name within an object, for example, {{incode|Unnamed#Body.Box001.Face17}}.
[[Image:ObjectSelection.png|none]]


It also allows to perform some actions like [[Std_ViewFitSelection|Std ViewFitSelection]], and sending the object to the [[Python_console|Python console]].


===Object export===
==Model and Task panes==
Items can be selected, or deselected, one at a time, by holding keyboard control key clicking left mouse button.


''This should be in the [[selection view]] page.''
A range of items can be selected by left clicking on first item, then press and hold shift key and click on last item.


Select any complex object, for example, a [[PartDesign_Body|PartDesign Body]] or [[Std_Part|Std Part]], then in the [[selection_view|selection view]] select again the object, and then press {{KEY|Ctrl}} + {{KEY|C}} in the keyboard to open the {{MenuCommand|Object selection}} dialog. This allows copying the selected object together with all or only some of that object's dependency objects. For example, for a [[Std_Part|Std Part]] the possible objects to select include the [[Std_Part|Std Part]] itself, but also its Origin, its three base axes (XYZ), and its three base planes (XY, YZ, XZ).
Selection of single item will also show the properties in property pane.


After pressing {{Button|OK}}, the selected objects are copied into memory, and then can be pasted in the document to duplicate these objects only.
Double clicking will open any associate Task view containing a subset of common properties. Make sure to close this Task before switching to any other Workbench.


[[File:ObjectSelection.png]]
More methods are available by right clicking, see [[Tree_view#Selecting_Objects|Model Tree view-Selecting Objects]].


{{Caption|Object selection dialog that is launched from the [[Selection_view|selection view]].}}
These methods are not always available, for example Path Workbench, Job - Operations - Base Geometry Pane.

==Tree view==

In the [[tree_view|tree view]] items can be selected, or deselected, one at a time, by holding the {{KEY|Ctrl}} key and clicking with the mouse.

A range of items can be selected by clicking on the first item, holding {{KEY|Shift}}, and clicking on the last item.

Selecting a single item will also show its properties in the [[property_editor|property editor]].

Double clicking will open any associated [[task_panel|task panel]] containing actions. Make sure to close this task panel before executing another command or switching to any other workbench.

More methods are available by opening the context menu (right-click), depending on the object selected or the active workbench; see the information in [[tree_view|tree view]].


==Scripting==
==Scripting==

Look in api for Gui.addSelection, Gui.Selection.Filters and addSelectionGate, which restricts GUI from letting user select objects specified in the selection gate. User sees a red circle stop sign with diagional line when mouse over item NOT in the selectionGate.
Selecting objects is inherently a graphical task and therefore it is only available when the graphical user interface is loaded.

These commands can be used in [[Macros|macros]] or from the [[Python_console|Python console]].

</translate>
{{Code|code=
import FreeCADGui as Gui

Gui.Selection.addSelection
Gui.Selection.addSelectionGate
Gui.Selection.Filter
}}
<translate>

The command {{incode|addSelectionGate}} restricts the user from selecting objects not specified in the selection string. A symbol appears when the pointer is over an item not in the specified group.

</translate>
{{Code|code=
Gui.Selection.addSelectionGate("SELECT Part::Feature SUBELEMENT Edge")
}}
<translate>

See the [[Source_documentation|Source documentation]] and [[Std_PythonHelp|Std PythonHelp]] for more help on using these tools.


{{docnav
{{docnav
Line 55: Line 91:


{{Userdocnavi}}
{{Userdocnavi}}
</translate>

[[Category:User Documentation]]

Revision as of 06:11, 11 February 2020

Selection methods in FreeCAD allow picking objects in the 3D view, tree view, selection view, and other dialogs. Some selection methods are workbench specific and are documented in the particular workbench documentation.

3D view

In the 3D view there are various ways of selecting objects using the mouse pointer.

Simple selection

Simple selection with the mouse (by default left-click) and pre-selection (hover) are described in the mouse navigation page.

Repeated clicks

The first click selects a sub-element (vertex, edge or face) of the object under the mouse. A second click selects the whole object. introduced in version 0.18

The third click extends the selection to its container object (PartDesign Body, Std Part, and others). Further clicks expand the selection up the container chain. introduced in version 0.19

Selection commands

Mouse drag selection to select multiple objects or sub-elements (vertices or faces) is available using Std SelectAll, Std BoxSelection, Part BoxSelection, and Std BoxElementSelection.

The Box selection modes revert to the default Std SelectAll, after any selection. (What does this mean??)

Selection view

The selection view shows the names of the objects being selected, including their full name within an object, for example, Unnamed#Body.Box001.Face17.

It also allows to perform some actions like Std ViewFitSelection, and sending the object to the Python console.

Object export

This should be in the selection view page.

Select any complex object, for example, a PartDesign Body or Std Part, then in the selection view select again the object, and then press Ctrl + C in the keyboard to open the Object selection dialog. This allows copying the selected object together with all or only some of that object's dependency objects. For example, for a Std Part the possible objects to select include the Std Part itself, but also its Origin, its three base axes (XYZ), and its three base planes (XY, YZ, XZ).

After pressing OK, the selected objects are copied into memory, and then can be pasted in the document to duplicate these objects only.

Object selection dialog that is launched from the selection view.

Tree view

In the tree view items can be selected, or deselected, one at a time, by holding the Ctrl key and clicking with the mouse.

A range of items can be selected by clicking on the first item, holding Shift, and clicking on the last item.

Selecting a single item will also show its properties in the property editor.

Double clicking will open any associated task panel containing actions. Make sure to close this task panel before executing another command or switching to any other workbench.

More methods are available by opening the context menu (right-click), depending on the object selected or the active workbench; see the information in tree view.

Scripting

Selecting objects is inherently a graphical task and therefore it is only available when the graphical user interface is loaded.

These commands can be used in macros or from the Python console.

import FreeCADGui as Gui

Gui.Selection.addSelection
Gui.Selection.addSelectionGate
Gui.Selection.Filter

The command addSelectionGate restricts the user from selecting objects not specified in the selection string. A symbol appears when the pointer is over an item not in the specified group.

Gui.Selection.addSelectionGate("SELECT Part::Feature SUBELEMENT Edge")

See the Source documentation and Std PythonHelp for more help on using these tools.