Std ToggleVisibility: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 19: Line 19:
|Name=Std ToggleVisibility
|Name=Std ToggleVisibility
|Empty=1
|Empty=1
|MenuLocation=View → Visibility → Toggle visibility
|MenuLocation=View → Toggle visibility
|Workbenches=All
|Workbenches=All
|Shortcut={{KEY|Space}}
|Shortcut={{KEY|Space}}
Line 34: Line 34:
# Select one or more objects.
# Select one or more objects.
# There are several ways to invoke the command:
# There are several ways to invoke the command:
#* Select the {{MenuCommand|View → Toggle visibility}} option from the menu.
#* Select the {{MenuCommand|View → Visibility → Toggle visibility}} option from the menu.
#* Select the {{MenuCommand|View → Visibility → Toggle visibility}} option from the menu.
#* Select the {{MenuCommand|Toggle visibility}} option from the [[Tree_view|Tree view]] context menu. This option is not available in the [[PartDesign_Workbench|PartDesign Workbench]].
#* Select the {{MenuCommand|Toggle visibility}} option from the [[Tree_view|Tree view]] context menu. This option is not available in the [[PartDesign_Workbench|PartDesign Workbench]].

Revision as of 18:52, 5 April 2020

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.


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 objects in all 3D views belonging to the active document.

Usage

  1. Select one or more objects.
  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.
    • Use the keyboard shortcut: Space.

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()