Std ToggleVisibility: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 27: Line 27:
==Description== <!--T:2-->
==Description== <!--T:2-->


The '''Std ToggleVisibility''' command toggles the visibility of objects.
The '''Std ToggleVisibility''' command toggles the visibility of selected objects.


==Usage== <!--T:11-->
==Usage== <!--T:11-->

Revision as of 10:02, 6 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 selected objects.

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.

Notes

  • The action of this command cannot be undone with Std Undo.
  • The visibility of an object can also be changed through its DataVisibility parameter 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()