Selection API
(October 2019) Do not edit this page. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself, see Source documentation.
The selection submodule is part of the FreeCADGui module. Example:
import FreeCADGui
sel = FreeCADGui.Selection.getSelection()
{{APIFunction|addSelection|FreeCAD.Object|Adds an object to the selection| }}
{{APIFunction|clearSelection|[string]|Clears the selection of the given document name. If no document is given the complete selection is cleared.| }}
{{APIFunction|getSelection|[string]|Returns a list of selected document objects for a given document name. If no document is given the complete selection is returned.|a list of document objects in the order they were selected.}}
{{APIFunction|getSelectionEx|[string]|Returns a list of SelectionObject for a given document name. If no document is given the complete selection is returned. Used for selecting subobjects (ex some Edges of a Face).|a list of SelectionObjects in the order they were selected}}
{{APIFunction|isSelected|FreeCAD.Object|Checks if a given object is selected| }}
{{APIFunction|removeSelection|FreeCAD.Object|Removes an object from the selection| }}
⏵ documentation index > API > Poweruser Documentation > Selection API
This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/Selection_API.md