Coordinate Frame

Command

Not Applicable

Description

Set Coordinate Frame is used to describe a convenience coordinate frame for subsequent drawing oprations. X1 and Y1 indicate the coordinate of the lower left corner, and X2, Y2 indicate the upper right corner.

Escapes

The Set Coordinate Frame block does not produce any escapes.

Examples

This example shows an axis moving to an indicated position on a form based on a mouse click:

... producing this:

If it was desired to "snap" to a grid location and not permit moving to positions in between grids this change could be made:

Perhaps the use wants to change the destination on the fly. The way to do this is to use the non-blocking move command Begin Move To permitting another mouse event to occur before the move is finished:

If a click is made, and then a further click is made, the motion will blend to the new destination without stopping at the first. However a new kind of problem can occur. If the new target is behind the current motion rather than still ahead this re-targeting cannot be done. In this case a Motion Overrun Escape Code is generated:

The desired behavior would be to abandon the no longer desired original target by stopping early and heading towards the new target. This is done as show below with a Try Recover block:

Related Topics

Draw Line
Set Line Color
Clear