Macro Toggle Panels Visibility: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
 
(32 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<languages/>
{{Macro|Icon=Macro_Toggle_Views_Visibility.png|Name=Macro Toggle Views Visibility|Description=This macro toggles the visibility of various supporting views in FreeCAD, allowing the main window to be viewed with all available screen space.|Author=PiffPoof}}
<translate>


<!--T:1-->
==Description==
{{Macro
When using the Sketcher the right-button menu is redefined to hold options relevant to the Sketcher. Consequently the option to change the Navigational Style, which is available when outside the Sketcher, is not available when in the Sketcher.
|Name=Macro Toggle Panels Visibility
|Icon=Macro_Toggle_Views_Visibility.png
|Description=This macro toggles the visibility of various supporting views in FreeCAD, allowing the main window to be viewed with all available screen space.
|Author=Piffpoof
|Version=1.0
|Date=2015-01-17
|FCVersion=All
|Download=[https://wiki.freecad.org/images/d/d0/Macro_Toggle_Views_Visibility.png ToolBar Icon]
|SeeAlso=[https://forum.freecadweb.org/viewtopic.php?f=22&t=30450&hilit=Toggle_Panels Toggle Panels]
}}


==Description== <!--T:7-->
==Installation==
There are two brief code snippets, each of which is a separate Macro. Installation is comprised of copying the two pieces code to the appropriate Macro directory and invoking them from the Macro menu. It is much preferable to add them both to a toolbar so as to be easily available while using the Sketcher.


<!--T:2-->
==Usage==
When working with FreeCAD there are times when you need many supporting windows open, such as Combo View, Report View, etc. There are other times when you want all the clutter of the supporting windows to disappear so that all the screen space available can be used to view the model being worked with. This macro lets you hide all the supporting windows (or make them visible again) with one click on the toolbar.
Click on the associated toolbar button, or invoke from the Macro menu. There is no visible confirmation of their executing, aside from the Navigational Style will change.


==Installation== <!--T:8-->
==User Interface==
There really isn't any user interface, not even any confirmation that the Navigational Style has been changed. The confirmation will be when you next manipulate the view, your mouse movements will interpreted in the Navigational Style you selected.


<!--T:3-->
==Scripts==
Save the provided code to the appropriate Macro directory and execute it from the Macro menu. It is preferable to add it to a toolbar for ease of access.
* see [[How_to_install_macros|How to install macros]] for information on how to install this macro code
* see [[Customize_Toolbars|Customize Toolbars]] for information how to install as a button on a toolbar

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

<!--T:4-->
Click on the associated toolbar button, or invoke from the Macro menu. The supporting windows Python console, Report view, Combo view will either all become visible or all become hidden.

==User Interface== <!--T:10-->

<!--T:5-->
There is immediate confirmation of the user action as the supporting windows either appear or disappear.

==Scripts== <!--T:6-->

<!--T:11-->
Toolbar icon [[Image:Macro_Toggle_Views_Visibility.png]]

</translate>
'''Macro_Toggle_Panels_Visibility.FCMacro'''

{{MacroCode|code=
# -*- coding: utf-8 -*-
# macro to toggle visibility of Report view, Python console, Combo view
from PySide import QtCore, QtGui
mainWindow = FreeCADGui.getMainWindow()
dockWidgets = mainWindow.findChildren(QtGui.QDockWidget)
for dw in dockWidgets:
if dw.objectName() == "Python console":
pcWidget = dw
if dw.objectName() == "Combo View":
cvWidget = dw
if dw.objectName() == "Report view":
rvWidget = dw
if pcWidget.isVisible():
pcWidget.hide()
cvWidget.hide()
rvWidget.hide()
else:
pcWidget.show()
cvWidget.show()
rvWidget.show()


{{Code|code=
# change to CAD Navigational Style
p=App.ParamGet("User parameter:BaseApp/Preferences/View")
p.SetString("NavigationStyle","Gui::CADNavigationStyle")
}}
}}

{{clear}}

Latest revision as of 16:19, 30 December 2023

Other languages:

Macro Toggle Panels Visibility

Description
This macro toggles the visibility of various supporting views in FreeCAD, allowing the main window to be viewed with all available screen space.

Macro version: 1.0
Last modified: 2015-01-17
FreeCAD version: All
Download: ToolBar Icon
Author: Piffpoof
Author
Piffpoof
Download
ToolBar Icon
Links
Macro Version
1.0
Date last modified
2015-01-17
FreeCAD Version(s)
All
Default shortcut
None
See also
Toggle Panels

Description

When working with FreeCAD there are times when you need many supporting windows open, such as Combo View, Report View, etc. There are other times when you want all the clutter of the supporting windows to disappear so that all the screen space available can be used to view the model being worked with. This macro lets you hide all the supporting windows (or make them visible again) with one click on the toolbar.

Installation

Save the provided code to the appropriate Macro directory and execute it from the Macro menu. It is preferable to add it to a toolbar for ease of access.

Usage

Click on the associated toolbar button, or invoke from the Macro menu. The supporting windows Python console, Report view, Combo view will either all become visible or all become hidden.

User Interface

There is immediate confirmation of the user action as the supporting windows either appear or disappear.

Scripts

Toolbar icon

Macro_Toggle_Panels_Visibility.FCMacro

# -*- coding: utf-8 -*-
# macro to toggle visibility of Report view, Python console, Combo view
from PySide import QtCore, QtGui
mainWindow = FreeCADGui.getMainWindow()
dockWidgets = mainWindow.findChildren(QtGui.QDockWidget)
for dw in dockWidgets:
    if dw.objectName() == "Python console":
        pcWidget = dw
    if dw.objectName() == "Combo View":
        cvWidget = dw
    if dw.objectName() == "Report view":
        rvWidget = dw
     
if pcWidget.isVisible():
    pcWidget.hide()
    cvWidget.hide()
    rvWidget.hide()
else:
    pcWidget.show()
    cvWidget.show()
    rvWidget.show()