Std ToggleVisibility: Difference between revisions

From FreeCAD Documentation
mNo edit summary
m (Added a description of toggled appearance in the tree view.)
Line 39: Line 39:
#* Select the {{MenuCommand|[[Image:Std_ToggleVisibility.svg|16px]] Toggle visibility}} option from the 3D view context menu.
#* Select the {{MenuCommand|[[Image:Std_ToggleVisibility.svg|16px]] Toggle visibility}} option from the 3D view context menu.
#* Use the keyboard shortcut: {{KEY|Space}}.
#* Use the keyboard shortcut: {{KEY|Space}}.
When toggled 'true' visible objects will appear with icon's (if present) in colour and tree entry in '''Boldface'''.
A toggled object will assume the same visibility as it's hierarchical parent. (E.G. In PartDesign, if the body is invisible, all features in that body will also be invisible.)


==Notes== <!--T:7-->
==Notes== <!--T:7-->

Revision as of 13:37, 8 February 2021

Std ToggleVisibility

Menu location
View → Toggle visibility
Workbenches
All
Default shortcut
Space
Introduced in version
-
See also
Std ShowSelection, Std HideSelection, Std ToggleObjects, Std ShowObjects, Std HideObjects

Description

The Std ToggleVisibility command toggles the visibility of selected objects in 3D views.

Usage

  1. Select one or more objects.
    • Invisible objects can be selected in the Tree view.
    • Be careful when you use Ctrl+A to select all objects in the Tree view. This will also selects sub-elements of PartDesign bodies and objects used for Part Booleans. In most cases these should stay invisible.
    • Objects used for Part Booleans are also selected when you use Ctrl+A in a 3D view.
  2. There are several ways to invoke the command:
    • Select the View → Toggle visibility option from the menu.
    • Select the View → Visibility → Toggle visibility option from the menu.
    • Select the Toggle visibility option from the Tree view context menu. This option is not available in the PartDesign Workbench.
    • Select the Toggle visibility option from the 3D view context menu.
    • Use the keyboard shortcut: Space.

When toggled 'true' visible objects will appear with icon's (if present) in colour and tree entry in Boldface. A toggled object will assume the same visibility as it's hierarchical parent. (E.G. In PartDesign, if the body is invisible, all features in that body will also be invisible.)

Notes

  • The action of this command cannot be undone with Std Undo.
  • The visibility of an object can also be changed through its related DataVisibility property in the Property editor or the Combo view.

Scripting

See also: FreeCAD Scripting Basics.

Use the show and hide methods of an object to change its visibility.

import FreeCADGui

obj = FreeCADGui.ActiveDocument.myObjectName

if obj.Visibility == True:
  obj.hide()
else:
  obj.show()