Magic VLSI Layout Tool Version 7.3 *


Move box dist units in direction or (with no arguments) show box size.


Key macro b implements the command box (with no arguments), which prints information about the box to the console (terminal stdout).


box [option]

where option is one of the following:
[direction [distance]]
Move the box in the indicated direction by the indicated distance.
width [width]
Set or return box width
height [height]
Set or return box height
size [width height]
Set or return box size
position [llx lly] [-edit]
Set or return box position
values [llx lly urx ury] [-edit]
Set or return box coordinates.
move direction distance|cursor
Move box position
grow direction distance
Expand box size
shrink direction distance
Shrink box size
corner direction distance|cursor
Reposition a box corner
Is the cursor box present?
Print help information


The box command, with no arguments, prints information about the current position and size of the cursor box to the console (terminal stdout). The output shows the lower-left and upper-right coordinates of the box, plus the box width, height, and area. These coordinates and dimensions are shown both in microns and in lambda units. If the internal grid has been subdivided to a finer grid than lambda, then internal units will also be reported.

With arguments, the box command adjusts the position and dimensions of the cursor box as outlined in the Usage section (see above). The -edit switch causes coordinate values to be reported relative to the origin of the current edit cell, if the edit cell is not the topmost cell in the layout window.

For a discussion of valid distances, see the page distance. This includes dimensional values such as width and height, e.g.,

box width 1.2um
Note that because metric dimensions do not always match lambda dimensions, the dimension may be rounded down to the nearest lambda. This is important in case this use of box is intended to meet some DRC requirement. For the options move and corner, the distance may be the keyword "cursor", indicating that the box should be moved or the corner repositioned to the position of the cursor. These versions of the command implement the standard mouse button bindings for the "box tool" in layout windows.

For a discussion of valid directions, see the page direction. Note that special cases box grow center and box shrink center will cause the box to expand or shrink on all sides, whereas box move center is nonfunctional. Also, the box corner command expects the direction to be a nonmanhattan direction (ur, bl, etc.), indicating the corner to be repositioned.

Implementation Notes:

box is implemented as a magic built-in command. Command options with keywords and no arguments return Tcl results in the Tcl version of magic. However, to be backwardly compatible with versions of magic prior to 7.3, the box command with no arguments prints information directly to stdout (the command-line console). The separate option box values is provided to return the two box coordinates (lower-left and upper-right) as a Tcl list.

The use of returned Tcl values allows various useful constructs on the command-line, such as:

box move e [box width] box height [box width]
The first example moves the box to the right by the width of the box, while the second example makes the box square by adjusting the height to match the width.

See Also:

snap scalegrid

Return to command index

Last updated: November 8, 2004 at 2:53pm