Drawings SDK Developer Guide > Working with .dwg Files > Working with Databases > Working with Database Containers > Working with Dictionaries of Objects > Working with Specific Dictionaries > Layout Dictionary > Concept of Layouts
Concept of Layouts

A layout is an association between geometry and plot settings for a specific printing device.

Geometry to be plotted is defined in a block object, which is a container that stores entities.

Settings include:

  • Plot settings that determine how the geometry should be plotted on media for a print device
  • Plot style and sheet settings used for plotting
  • Plot area that specifies the geometry from the block to be plotted

The block is a block record object which is implemented using the OdDbBlockTableRecord class. The layout object is implemented using the OdDbLayout class which is derived from the OdDbPlotSettings class. Layouts and blocks have a double-sided association: the layout object stores the ID of the associated block record object, and the block record object stores the ID of the associated layout object.

The database object stores layout objects in a layout dictionary and stores the block record objects in a block table object. If a block is associated with a layout, its "Layout" status is set to True. The block table object also stores other block record objects which are not associated with layouts, in which case the layout ID is set to kNull and the "Layout" status is set to False.

Each layout must have a unique name which identifies it and is used by other objects to refer to the layout.

A database must contain layouts. By default, the layout dictionary contains three predefined layouts, and the block table contains three predefined block records associated with these layouts:

  •  "Model" layout and "*Model_Space" block — Defines the model space layout of a drawing.
  •  "Layout1" layout and "*Paper_Space" block — Defines the first paper space layout of a drawing.
  •  "Layout2" layout and "*Paper_Space0" block — Defines the second paper space layout of a drawing.

The database must contain the model layout associated with the model space predefined block and at least one paper layout associated with the paper space predefined block. There can be only one model layout, and it always has the predefined name "Model" which cannot be changed. The model layout has a predefined association with model space of the database. The database can have several paper layouts which can have various and changeable names. A paper layout usually contains viewport entities displaying contents of model space and two-dimensional entities such as title blocks, annotations, etc. One of the paper layouts may be the current layout and it defines the association with paper space of the database. The database can switch between paper layouts, making any one of them current. The current paper layout specifies the block record object which is used as paper space of the database.

The name of the block record object associated with the current paper layout assigned for paper space is always "*Paper_Space". Other paper layouts have the name "*Paper_SpaceN", where N is an Integer. Numbering of layout block names starts at zero and increments by one when a new layout is created in the database. When a paper layout becomes current, the database swaps its block name with the block name of the layout which was previously current. For example, if the "Layout1" layout is current and is associated with the "*Paper_Space" block, the "Layout2" layout is not current and is associated with the "*Paper_Space0" block. When the "Layout2" layout becomes current, its block is renamed to "*Paper_Space" and the block associated with the "Layout1" layout is renamed to "*Paper_Space0". The current paper layout is always associated with paper space.

One of the layouts is the current active layout. The active layout defines the current block of geometry and settings which are used by default for many functions of the database object and with which a user currently works. The current active layout can be any layout type: model or paper. A database has a "Tile mode" status which defines the space of the database that is currently active. When "Tile mode" is True, model space is active and the associated model layout is currently active. When "Tile mode" is False, paper space is active and the associated paper layout is currently active. Switching the tile mode changes the layout and space.

Switching between layouts defines tab functionality, which are numbered in sequence beginning at zero. The predefined "Model" layout always has the tab order zero. Paper layouts have a changeable tab order beginning with one up to the number of paper layouts.

See Also

Working with Layouts

Organization of Layouts

Copyright © 2002 – 2021. Open Design Alliance. All rights reserved.