Snapping 2D Points to a Grid
- Last UpdatedNov 27, 2025
- 3 minute read
Cursor commands which request 2D points will be rounded to the nearest point on the SNAP grid (if on). The grid is defined by the SNAP command, for example:
|
SNAP ON |
- turn the snap grid on |
|
SNAP OFF |
- turn the snap grid off (the default) |
|
SNAP ON 10 |
- define a square grid, 10mm in both X and Y directions |
|
SNAP ON SPACING X25 Y40 |
- define a rectangular grid |
When the SNAP grid is ON, all 2D cursor hits (including the BY @ command) will be snapped onto the nearest grid point. This does not affect graphics picking or pseudo-3D cursor hits. Snapping only applies to cursor-generated positions; positions entered explicitly from the keyboard or via a macro are not snapped. Cursor hits will be snapped on any picture, whether or not the visible grid (see VGRID command below) is displayed.
By default, the SNAP grid origin is positioned at the bottom left-hand corner of the Sheet, and is drawn parallel to the X, Y axes of the Sheet. This origin may be changed by commands such as
|
SNAP AT X100 Y100 |
- define snap origin explicitly |
|
SNAP AT @ |
- define snap origin with cursor |
SNAP settings apply to all Sheets (and Symbol Libraries, Overlay Sheets etc) when SNAP is ON. The initial setting (on entry to Draft) is a square grid at the Sheet origin, with snapping switched off, that means,
SNAP OFF AT X 0mm Y 0mm SPACING X 25mm Y 25mm
If the current units on module entry are INCH or FINCH, the initial SNAP spacing is one inch square.
The snap grid may be queried using the command:
Q SNAP
The same information will also be output to file by a RECREATE DISPLAY command.
Visible Grids
VGRID ON
Visible grids are not output to plotfiles.
The VGRID command uses the current settings of the SNAP grid. A visible grid will be output on the current Sheet using some multiple (default 1) of the current SNAP grid. An element identifier may be specified as part of the command, for example:
VGRID /VIEW1-2 ON
This command would turn the visible grid on for the picture element (that means, the SHEE, LALB, BACK, OVER, ISOLB or SYLB) owning the specified element.
The visible grid is not maintained with changes in SNAP settings, so it is advisable to reset the grid (with another VGRID ON command) if the SNAP settings are changed.
The spacing of the visible grid may be changed by commands such as
|
VGRID SNAP 2 |
- change visible grid spacing to twice that of snap grid |
This command would give a less-cluttered grid display on the drawing. The default setting may be returned to by giving the command
VGRID SNAP
The following would cause a visible grid to be erased from the current Sheet (or a specified Sheet), where sheet identifier identifies a picture element or an owned element:
VGRID [sheet identifier] OFF
ERASE AIDS [IN sheet identifier]
ERASE VGRID [IN sheet identifier]
The following causes all visible grids to be erased:
Module switching
Entry to MDB mode
The snap multiple of the visible grid may be queried using the command:
Q VGRID
Details of the VGRID snap multiple will also be output to file by a RECREATE DISPLAY command.
It is also possible to query whether a specified Sheet currently has a visible grid displayed, using.
Q VGRID sheet_identifier