Std ViewFitSelection: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 36: Line 36:
#* Select the {{MenuCommand|[[Image:Std_ViewFitSelection.svg|16px]] Fit selection}} option from the [[3D_view|3D view]] context menu.
#* Select the {{MenuCommand|[[Image:Std_ViewFitSelection.svg|16px]] Fit selection}} option from the [[3D_view|3D view]] context menu.
#* Use the keyboard shortcut: {{KEY|V}} then {{KEY|S}}.
#* Use the keyboard shortcut: {{KEY|V}} then {{KEY|S}}.

==Scripting==

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

To change the view to 'fit all' use the {{incode|fitAll}} method of the ActiveView object. This method is not available if FreeCAD is in console mode.

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

FreeCADGui.ActiveDocument.ActiveView.fitAll()
}}
<translate>


{{Docnav
{{Docnav

Revision as of 14:12, 28 March 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 ViewFitSelection

Menu location
View → Standard views → Fit selection
Workbenches
All
Default shortcut
V S
Introduced in version
-
See also
Std ViewFitAll

Description

The Std ViewFitSelection command zooms and pans the camera so that all selected objects fit inside the active 3D view.

Usage

  1. There are several ways to invoke the command:
    • Press the Std ViewFitSelection button.
    • Select the View → Standard views → Fit selection option from the menu.
    • Select the Fit selection option from the 3D view context menu.
    • Use the keyboard shortcut: V then S.

Scripting

See also: FreeCAD Scripting Basics.

To change the view to 'fit all' use the fitAll method of the ActiveView object. This method is not available if FreeCAD is in console mode.

import FreeCADGui

FreeCADGui.ActiveDocument.ActiveView.fitAll()