Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

grid [-default] [-displayAxes boolean] [-displayAxesBold boolean] [-displayDivisionLines boolean] [-displayGridLines boolean] [-displayOrthographicLabels boolean] [-displayPerspectiveLabels boolean] [-divisions uint] [-orthographicLabelPosition string] [-perspectiveLabelPosition string] [-reset] [-size linear] [-spacing linear] [-style uint] [-toggle boolean]

grid is undoable, queryable, and NOT editable.

This command changes the size and spacing of lines on the ground plane displayed in the perspective and orthographic views.

This command lets you reset the ground plane, change its size and grid line spacing, grid subdivisions and display options.

Return value

None

In query mode, return type is based on queried flag.

Flags

default, displayAxes, displayAxesBold, displayDivisionLines, displayGridLines, displayOrthographicLabels, displayPerspectiveLabels, divisions, orthographicLabelPosition, perspectiveLabelPosition, reset, size, spacing, style, toggle
Long name (short name) Argument types Properties
-toggle(-tgl) boolean query
Turns the ground plane display off in all windows, including orthographic windows. Default is true.
-reset(-r)
Resets the ground plane to its default values
-default(-df) query
Used to specify/query default values.
-spacing(-sp) linear query
Sets the spacing between major grid lines in linear units. The default is 5 units.
-size(-s) linear query
Sets the size of the grid in linear units. The default is 12 units.
-divisions(-d) uint query
Sets the number of subdivisions between major grid lines. The default is 5. If the spacing is 5 units, setting divisions to 5 will cause division lines to appear 1 unit apart.
-displayAxes(-da) boolean query
Specify true to display the grid axes.
-displayGridLines(-dgl) boolean query
Specify true to display the grid lines.
-displayDivisionLines(-ddl) boolean query
Specify true to display the subdivision lines between grid lines.
-displayPerspectiveLabels(-dpl) boolean query
Specify true to display the grid line numeric labels in the perspective view.
-displayOrthographicLabels(-dol) boolean query
Specify true to display the grid line numeric labels in the orthographic views.
-displayAxesBold(-dab) boolean query
Specify true to accent the grid axes by drawing them with a thicker line.
-perspectiveLabelPosition(-plp) string query
The position of the grid's numeric labels in perspective views. Valid values are "axis" and "edge".
-orthographicLabelPosition(-olp) string query
The position of the grid's numeric labels in orthographic views. Valid values are "axis" and "edge".
-style(-st) uint query
This flag is obsolete and should not be used.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

//To toggle the grid display of the grid (in all views):
grid -toggle (! `grid -q -toggle`)

// To reset the grid to default values:
grid -reset;

// To change the grid spacing and subdivisions:
grid -spacing 10 -d 10;

// To set the defaults for inches
grid -default -spacing 1in -size 1ft -divisions 4;

// To change the size of the grid to 20x20, extending 10 units
 // in each direction:
grid -spacing 10;

// To query the current size of the grid:
// returns a size in the current linear unit.
grid -query -size;

// A typical grid would be a grid size of 20x20, with
// major grid lines every 5 units, with 5 divisions between
// major grid lines. This be done with the following command.
grid -size 10cm -sp 5.0cm -d 5 ;

// Turn on numeric grid labels.
//
grid -displayPerspectiveLabels true;

// Display grid labels along the axes.
//
grid -perspectiveLabelPosition "axis";