Std SelBoundingBox/en: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 26: Line 26:
#* Press the {{Button|[[Image:Std_SelBoundingBox.svg|16px]] [[Std_SelBoundingBox|Std SelBoundingBox]]}} button.
#* Press the {{Button|[[Image:Std_SelBoundingBox.svg|16px]] [[Std_SelBoundingBox|Std SelBoundingBox]]}} button.
#* Select the {{MenuCommand|View → [[Image:Std_SelBoundingBox.svg|16px]] Bounding box}} option from the menu.
#* Select the {{MenuCommand|View → [[Image:Std_SelBoundingBox.svg|16px]] Bounding box}} option from the menu.

==Preferences==

The related setting is stored: {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → View → ShowSelectionBoundingBox}}. It is a boolean value, the default is {{FALSE}}.

==Scripting==

{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To change the ShowSelectionBoundingBox setting use the {{incode|SetBool}} method of the appropriate ParameterGrp. The code sample does not work if FreeCAD is in console mode.

{{Code|code=
import FreeCAD, FreeCADGui

grp = FreeCAD.ParamGet('User parameter:BaseApp/Preferences/View')
if grp.GetBool('ShowSelectionBoundingBox'):
grp.SetBool('ShowSelectionBoundingBox',False)
else:
grp.SetBool('ShowSelectionBoundingBox',True)

FreeCADGui.updateCommands()
}}


{{Docnav
{{Docnav

Revision as of 18:51, 17 April 2020

Std SelBoundingBox

Menu location
View → Bounding box
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
Std DrawStyle

Description

The Std SelBoundingBox command toggles the bounding box highlighting mode. If this mode is switched on, selected objects are marked in a 3D view with a highlighted bounding box instead of a highlighted shape.

Usage

  1. There are several ways to invoke the command:
    • Press the Std SelBoundingBox button.
    • Select the View → Bounding box option from the menu.

Preferences

The related setting is stored: Tools → Edit parameters... → BaseApp → Preferences → View → ShowSelectionBoundingBox. It is a boolean value, the default is false.

Scripting

See also: FreeCAD Scripting Basics.

To change the ShowSelectionBoundingBox setting use the SetBool method of the appropriate ParameterGrp. The code sample does not work if FreeCAD is in console mode.

import FreeCAD, FreeCADGui

grp = FreeCAD.ParamGet('User parameter:BaseApp/Preferences/View')
if grp.GetBool('ShowSelectionBoundingBox'):
  grp.SetBool('ShowSelectionBoundingBox',False)
else:
  grp.SetBool('ShowSelectionBoundingBox',True)

FreeCADGui.updateCommands()