Edit - Snap To

Checking a choice in the Edit - Snap To menu controls Snap modes, which work with mouse cursor motion. Snap modes force the mouse cursor to take effect only at those discrete, specified locations that are nearest to the mouse cursor's location. We can also set snap modes using Snap Toolbar buttons. When snap modes are engaged the status bar will show snap is turned on.

When any snap mode is engaged a secondary reticule cursor will show the point of action. For example, with Snap To - Points set the point that is nearest to the mouse cursor will be highlighted with a reticule cursor that is magenta in color. If we click with the left mouse button the mouse cursor will jump immediately onto that point. This makes it possible to exactly pick out the location of a given point, for example to edit its position.

Checking Edit - Snap To - Lines will cause the snap cursor to jump to the nearest coordinate defining a line. In the illustration above, as the regular cursor is brought near the end of a line the snap cursor will appear at the end of the line.

As the cursor is brought near the end of the other line, the snap cursor will jump to the end of that line.

Snap to grid intersections, if View - Grid is enabled. Frequently used when adding controls to Forms .

Areas

Snap to the coordinates that define areas.

Lines

Snap to the coordinates that define lines.

Points

Snap to points.

Segments

Snap to arbitrary locations on segments defining line or area objects.

Selection

Snap only to those objects in the selection. Requires snap to areas, lines or points to be enabled.

More than one snap mode can be set simultaneously. For example, if Snap to Areas, Snap to Points and Snap to Selection are all checked then the cursor will jump to the nearest point or area coordinate that is in the selection.

Grid and Graticule Snap Modes

Snapping to grids and graticules is supported in most components; with drawing, image, labels, map, profile, surface and theme windows support snapping to grids and graticules.

Depressing the TAB key jumps the cursor immediately onto the snap reticule. This is used when we want the mouse cursor to jump immediately to the snap point without a mouse click.

Space Bar

Depressing the space bar turns off snap temporarily until the space bar is pressed again. This is very useful to temporarily turn snap off. When snap is turned off using the space bar the status bar will not show snap modes enabled.

Pressing the Tab key will cause the mouse cursor to jump immediately to the snap cursor.

Example

Suppose we would like to use the Tracker tool to measure distances from one point to other points. With Snap to Points checked, we position the snap reticule over the desired Tracker origin point and click with the left mouse button. Now, we move the mouse cursor near the point for which tracker measurement is desired so that the snap reticule highlights that point and we press the TAB key: the mouse cursor will immediately snap onto that point and the Tracker readout will provide the distance to that point. To measure the distance to another point we can move the reticule onto another point and press TAB again and the mouse cursor will snap to that point, and so on.

Snap modes also work in the middle of other commands. For example, suppose we would like to draw a circle that is centered on one point and that has its edge exactly on a particular area.

We push in Snap to Points and Snap to Areas and then use the Insert Circle on Center drawing tool to click on the first point and then drag the circle out to the area. In the example above, the magenta snap cursor appears at the point initially clicked. As we bring the mouse cursor near the area a square secondary snap cursor will appear at various coordinates that define the area that are nearest to the mouse cursor. When we release the mouse drag the circle will be created as denoted by the magenta snap cursor and the secondary box cursor.

Example

In this example we will reposition labels to the intersections of a grid.

Consider an unbound labels component. This was created as a bound labels component of place names in Mexico using the Mexico example drawing as a parent and then unlinked to create an unbound labels component. The example would work the same using a bound labels component, but if we had used a bound component the parent objects would have been shown in schematic preview in the background and thus the display might not have been as clear.

We first turn on grids by using View - Grid to specify a grid for the view to display. We use default values for the grid.

Next, we select one of the labels to be moved for editing by CTRL-ALT clicking on it.

When the label is selected for editing an edit handle appears at the tie point for the label.

At this point we can turn on Snap to Grid, but when we do so we discover we cannot click on the label's edit handle to drag it to a different position. When we try to do so we find that the Snap mode moves the cursor reticule onto the nearest grid intersection and not onto the edit handle as we would like.

The solution is to tap the spacebar on our keyboard to temporarily turn off Snap mode. We can then click and hold onto the edit handle so the square edit cursor appears on the edit handle. We hold the click down...

...while we simultaneously tap the spacebar again to turn Snap mode back on. The edit cursor now under the influence of Snap mode immediately jumps to the grid intersection nearest to the mouse arrow cursor.

When we release our click-and-hold the label snaps to the grid intersection.

We can click on the label again (which we can do without using the spacebar because it is now at a grid intersection to which the cursor will jump in Snap mode) and, holding the click, move the mouse arrow cursor to a different location.

As the mouse arrow cursor nears the upper grid intersection the square edit cursor jumps to that intersection.

When we release the click-and-hold the label will snap to the upper intersection.

Snap Tolerance

The Snap Tolerance parameter may be optionally specified in the Tool Properties pane to control how close the mouse must be to a snap item before a snap mode takes effect.

When a snap mode is on, the Snap Tolerance setting gives the distance in screen pixels or in physical units within which the cursor must be to a given snap item (such as a line when snapping to lines) before the cursor snaps to that item.

When the cursor is outside the snap tolerance range, snaps are not effective. Setting a small snap tolerance is therefore a good way of retaining the benefits of snap modes without having the snap cursor jump about in a disconcerting way if the mouse is nowhere near a snappable item.

Layer Snap Restrictions

Using Layer Restrictions a map layer can be made non-snappable. When a layer is so restricted, any snap modes will ignore items in that layer.

Note

Snap must find the nearest point for every mouse motion. The snap cursor will lag behind mouse motion if there is a very large number of points on screen, if we move the mouse very rapidly (snap will catch up when we slow down), or if the system is heavily loaded with a background task.

Troubleshooting

If snap appears not to be working, try pressing the spacebar to see if snap has temporarily been turned off. When snap is on the status bar will show snap mode turned on. If snap has been turned off using the space bar, the status bar will not show snap mode enabled even if a snap mode toolbar button is pressed in.