Std ViewFitAll

From FreeCAD Documentation

Std ViewFitAll

Menu location
View → Standard views → Fit all
Workbenches
All
Default shortcut
V F
Introduced in version
-
See also
Std ViewFitSelection

Description

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

Usage

  1. There are several ways to invoke the command:
    • Press the Fit all button.
    • Select the View → Standard views → Fit all option from the menu.
    • Select the Fit all option from the 3D view context menu.
    • Select the Fit all option from the Mini-cube menu of the Navigation Cube.
    • Use the keyboard shortcut: V then F.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

Use the fitAll method of the View object to zoom to fit all.

import FreeCADGui

view = FreeCADGui.ActiveDocument.ActiveView
view.fitAll()

For the active view the SendMsgToActiveView method of the FreeCADGui object can also be used.

import FreeCADGui

FreeCADGui.SendMsgToActiveView("ViewFit")