Std ToggleSelectability

From FreeCAD Documentation

Std ToggleSelectability

Menu location
View → Visibility → Toggle selectability
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
None

Description

The Std ToggleSelectability command toggles the selectability of objects in 3D views.

Usage

  1. Select one or more objects.
  2. There are several ways to invoke the command:
    • Select the View → Visibility → Toggle selectability option from the menu.
    • Select the Toggle selectability option from the Tree view context menu. This option is not available in the PartDesign Workbench.
    • Select the Toggle selectability option from the 3D view context menu.

Notes

  • The selectability of an object can also be changed through its related DataSelectable property in the Property editor or the Combo view.

Scripting

See also: FreeCAD Scripting Basics.

The Selectable property of an object determines its selectability.

import FreeCADGui

obj = FreeCADGui.ActiveDocument.myObjectName

if obj.Selectable == True:
  obj.Selectable = False
else:
  obj.Selectable = True