Std ToggleVisibility: Difference between revisions

From FreeCAD Documentation
(n)
No edit summary
(28 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>

{{Page in progress}}

<translate>
<translate>


{{Docnav
{{Template:UnfinishedDocu}}
|[[Std_TextureMapping|Std TextureMapping]]
|[[Std_ShowSelection|Std ShowSelection]]
|[[Std_View_Menu|Std View Menu]]
|IconL=
|IconR=
|IconC=Freecad.svg
}}


<!--T:1-->
<!--Empty=1 to suppress icon-->
{{GuiCommand|Name=Std ToggleVisibility|MenuLocation=[[Std View|View]] → Visibility → Select Option ‏‎||Workbenches=All|Shortcut=|SeeAlso=}}
{{GuiCommand
|Name=Std ToggleVisibility
|Empty=1
|MenuLocation=View → Toggle visibility
|Workbenches=All
|Shortcut={{KEY|Space}}
|SeeAlso=[[Std_ShowSelection|Std ShowSelection]], [[Std_HideSelection|Std HideSelection]], [[Std_ToggleObjects|Std ToggleObjects]], [[Std_ShowObjects|Std ShowObjects]], [[Std_HideObjects|Std HideObjects]]
}}


==Description== <!--T:2-->


The '''Std ToggleVisibility''' command toggles the visibility of selected objects in [[3D_view|3D views]].


==Usage== <!--T:11-->
[[Category:UnfinishedDocu]]

<!--T:3-->
# Select one or more objects.
#* Invisible objects can be selected in the [[Tree_view|Tree view]].
#* Be careful when you use {{KEY|Ctrl}}+{{KEY|A}} to select all objects in the Tree view. This will also selects sub-elements of [[PartDesign_Body|PartDesign bodies]] and objects used for [[Part_Boolean|Part Booleans]]. In most cases these should stay invisible.
#* Objects used for [[Part_Boolean|Part Booleans]] are also selected when you use {{KEY|Ctrl}}+{{KEY|A}} in a 3D view.
# 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|Toggle visibility}} option from the Tree view context menu. This option is not available in the [[PartDesign_Workbench|PartDesign Workbench]].
#* Use the keyboard shortcut: {{KEY|Space}}.

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

* The action of this command cannot be undone with [[Std_Undo|Std Undo]].
* The visibility of an object can also be changed through its {{PropertyData|Visibility}} parameter in the [[Property_editor|Property editor]] or the [[Combo_view|Combo view]].

==Scripting==

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

Use the {{incode|show}} and {{incode|hide}} methods of an object to change its visibility.


</translate>
</translate>
{{Code|code=
import FreeCADGui

obj = FreeCADGui.ActiveDocument.myObjectName

if obj.Visibility == True:
obj.hide()
else:
obj.show()
}}
<translate>

{{Docnav
|[[Std_TextureMapping|Std TextureMapping]]
|[[Std_ShowSelection|Std ShowSelection]]
|[[Std_View_Menu|Std View Menu]]
|IconL=
|IconR=
|IconC=Freecad.svg
}}

</translate>
{{Std Base navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}
<languages/>

Revision as of 13:30, 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 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.
    • 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()