Layout Extents and Limits

The extents and limits of an layout represents borders which can be referenced by the ZOOM command or read from some header variables from the HeaderSection, if the creator application maintains these values – ezdxf does it not automatically.

Extents

The extents of an layout are determined by the maximum extents of all DXF entities that are in this layout. The command:

ZOOM extents

sets the current viewport to the extents of the currently selected layout.

A paper space layout in an arbitrary zoom state:

../_images/zoom_overview_800px.png

The same layout after the ZOOM extents command:

../_images/zoom_extents_800px.png

Limits

Sets an invisible rectangular boundary in the drawing area that can limit the grid display and limit clicking or entering point locations. The default limits for paper space layouts is defined by the paper size.

The layout from above after the ZOOM all command:

../_images/zoom_all_800px.png

See also

The AutoCAD online reference for the ZOOM and the LIMITS command.

Read Stored Values

The extents of the model space (the tab called “Model”) are stored in the header variable $EXTMIN and $EXTMAX. The default values of $EXTMIN is (+1e20, +1e20, +1e20) and $EXTMAX is (-1e20, -1e20, -1e20), which do not describe real borders. These values are copies of the extents attributes of the Layout object as Layout.dxf.extmin and Layout.dxf.extmax.

The limits of the modelspace are stored in the header variables $LIMMIN and $LIMMAX and have default values of (0, 0) and (420, 297), the default paper size of ezdxf in drawing units. These are copies of the Layout attributes Layout.dxf.extmin and Layout.dxf.extmax.

The extents and the limits of the actual paper space layout, which is the last activated paper space layout tab, stored in the header variable $PEXTMIN, $PEXTMAX, $PLIMMIN and $PLIMMAX.

Each paper space layout has its own values stored in the Layout attributes Layout.dxf.extmin, Layout.dxf.extmax, Layout.dxf.limmin and Layout.dxf.limmax.

Setting Extents and Limits

Since v0.16 ezdxf it is sufficient to define the attributes for extents and limits (Layout.dxf.extmax, Layout.dxf.limmin and Layout.dxf.limmax) of Layout object. The header variables are synchronized when the document is saved.

The extents of a layout are not calculated automatically by ezdxf, as this can take a long time for large documents and correct values are not required to create a valid DXF document.