Macro Toggle Panels Visibility: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 2: Line 2:


==Description==
==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.
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.


==Installation==
==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.
Installation is comprised of copying the two code to the appropriate Macro directory and invoking it from the Macro menu. It is much preferable to add it both to a toolbar so as to be more easily available.


==Usage==
==Usage==
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.
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==
==User Interface==
There is immediate confirmation of the user action as the supporting windows either appear or disappear.
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.


==Scripts==
==Scripts==


{{Code|code=
{{Code|code=
# macro to toggle visibility of Report view, Python console, Combo view
# change to CAD Navigational Style
from PySide import QtCore, QtGui
p=App.ParamGet("User parameter:BaseApp/Preferences/View")
mainWindow = FreeCADGui.getMainWindow()
p.SetString("NavigationStyle","Gui::CADNavigationStyle")
dockWidgets = mainWindow.findChildren(QtGui.QDockWidget)

for i in dockWidgets:
if i.objectName() == "Python console":
pcWidget = i
if i.objectName() == "Combo View":
cvWidget = i
if i.objectName() == "Report view":
rvWidget = i

if pcWidget.isVisible():
pcWidget.hide()
cvWidget.hide()
rvWidget.hide()
else:
pcWidget.show()
cvWidget.show()
rvWidget.show()
}}
}}

Revision as of 08:53, 17 January 2015

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
Author
PiffPoof
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

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.

Installation

Installation is comprised of copying the two code to the appropriate Macro directory and invoking it from the Macro menu. It is much preferable to add it both to a toolbar so as to be more easily available.

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

# 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 i in dockWidgets:
	if i.objectName() == "Python console":
		pcWidget = i
	if i.objectName() == "Combo View":
		cvWidget = i
	if i.objectName() == "Report view":
		rvWidget = i

if pcWidget.isVisible():
	pcWidget.hide()
	cvWidget.hide()
	rvWidget.hide()
else:
	pcWidget.show()
	cvWidget.show()
	rvWidget.show()