next up previous contents index
Next: Grid Style Up: Main Functions 3 Previous: Main Functions 3   Contents   Index

Grid and Edge Snapping

(int) SetMfgGrid(mfg_grid)
This will set the manufacturing grid to the value of the argument, provided that the value is in the range 0.0 - 100.0 microns. When the manufacturing grid is nonzero, the snap grid is constrained to integer multiples of the manufacturing grid. The function returns 1 if the argument is in range, in which case the value is accepted, 0 otherwise.

(real) GetMfgGrid()
This function returns the value of the manufacturing grid. When nonzero, the snap grid is constrained to integer multiples of the manufacturing grid.

(int) SetGrid(interval, snap, win)
This function sets the grid parameters for the window indicated by the third argument, which is 0 for the main window or 1-4 for the sub-windows. The interval argument sets snap grid spacing, in microns. This value can be zero, in which case the present value is retained.

The snap value is an integer in the range of -10 to 10. If positive, the number provides the number of snap grid intervals between fine grid lines. If negative, the absolute value is the number of fine grid lines displayed per snap grid interval. If zero, the present setting is retained.

For electrical mode windows, the snap points must be on multiples of one micron. If not, this function returns 0 and the grid is unchanged. The function also returns 0 if the window argument does not correspond to an existing window. The return is 1 if the operation succeeds.

The function does not redraw the window. The Redraw() function can be called to redraw the window if necessary.

(real) GetGridInterval(win)
This function returns the fine grid interval in microns for the grid in the window indicated by the argument, which is 0 for the main window or 1-4 for the sub-windows. The function returns 0 if the argument does not correspond to an existing window.

(real) GetSnapInterval(win)
This function returns the snap grid interval in microns for the grid in the window indicated by the argument, which is 0 for the main window or 1-4 for the sub-windows. The function returns 0 if the argument does not correspond to an existing window.

(int) GetGridSnap(win)
This function returns the snap number for the grid in the window specified by the argument, which is 0 for the main window or 1-4 for the sub-windows. The snap number determines the number of snap grid intervals between fine grid lines if positive, or fine grid lines per snap interval if negative. The function returns 0 if the argument does not correspond to an existing window.

(int) ClipToGrid(coord, win)
The first argument to this function is a coordinate in microns. The return value is the coordinate, in microns, snapped to the nearest snap point of the grid of the window given in the second argument. The second argument is 0 for the main window, or 1-4 for the sub-windows. The function fails if the window argument does not correspond to an existing window.

Note that this function must be called twice for an x,y coordinate pair. This function ignores the edge-snapping modes, only taking into account the grid resolution and snap values.

(int) SetEdgeSnappingMode(win, mode)
Change the edge snapping mode in a drawing window. The first argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The change will apply only to that window, though changes in the main window will apply to new sub-windows. The second argument is an integer in the range 0-2. The effects are

0 No edge snapping.
1 Edge snapping is enabled in some commands.
2 Edge snapping is always enabled.

The return value is 1 if the window edge snapping was updated, 0 otherwise.

(int) SetEdgeOffGrid(win, off_grid)
This will enable snapping to off-grid locations when edge snapping is enabled, in the given window. The first argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The second argument is a boolean which will allow off-grid snapping when true. The return value is 1 if the window parameter was updated, 0 otherwise.

(int) SetEdgeNonManh(win, non_manh)
This will enable snapping to non-Manhattan edges when edge snapping is enabled, in the given window. The first argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The second argument is a boolean which will allow snapping to non-Manhattan edges when true. The return value is 1 if the window parameter was updated, 0 otherwise.

(int) SetEdgeWireEdge(win, wire_edge)
This will enable snapping to wire edges when edge snapping is enabled, in the given window. The first argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The second argument is a boolean which will allow snapping to wire edges when true. The return value is 1 if the window parameter was updated, 0 otherwise.

(int) SetEdgeWirePath(win, wire_path)
This will enable snapping to the wire path when edge snapping is enabled, in the given window. The path is the set of line segments that invisibly run along the center of the displayed wire, which, along with the wire width and end style, actually defines the wire. The first argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The second argument is a boolean which will allow snapping to the wire path when true. The return value is 1 if the window parameter was updated, 0 otherwise.

(int) GetEdgeSnappingMode(win)
This function returns the edge snapping mode in effect for the given window. The argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The return value is -1 if the window is not found, 0-2 otherwise.

0 No edge snapping.
1 Edge snapping is enabled in some commands.
2 Edge snapping is always enabled.

(int) GetEdgeOffGrid(win)
This returns the setting of the allow off-grid edge snapping flag for the given window. The argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The return value is -1 if the window is not found, 0 or 1 otherwise tracking the state of the flag.

(int) GetEdgeNonManh(win)
This returns the setting of the allow non-Manhattan edge snapping flag for the given window. The argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The return value is -1 if the window is not found, 0 or 1 otherwise tracking the state of the flag.

(int) GetEdgeWireEdge(win)
This returns the setting of the allow wire-edge edge snapping flag for the given window. The argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The return value is -1 if the window is not found, 0 or 1 otherwise tracking the state of the flag.

(int) GetEdgeWirePath(win)
This returns the setting of the allow wire-path edge snapping flag for the given window. The argument is an integer representing the drawing window: 0 for the main window, and 1-4 for subwindows. The return value is -1 if the window is not found, 0 or 1 otherwise tracking the state of the flag.

(int) SetRulerSnapToGrid(snap)
This function sets the snap-to-grid behavior when creating rulers in the Rulers command. When set, the mouse cursor will snap to grid locations, otherwise not. In either case the cursor may snap to object edges if edge snapping is enabled. If the Rulers command is active the mode will change immediately, otherwise the new mode will apply when the command becomes active. The return value is 0 or 1 representing the previous flag value.

(int) SetRulerEdgeSnappingMode(mode)
This sets the edge snapping mode which is applied during the Rulers command. This command has its own default edge snapping state. This function changes only the initial state when the command starts, and will have no effect in a running command (use SetEdgeSnappingMode to alter the current setting). The argument is an integer 0-2.

0 No edge snapping.
1 Edge snapping is enabled in some commands.
2 Edge snapping is always enabled.

The function returns -1 if the argument is out of range, or 0-2 representing the previous state otherwise.

(int) SetRulerEdgeOffGrid(off_grid)
This sets the edge snapping allow off-grid flag which is applied during the Rulers command. This command has its own default edge snapping state. This function changes only the initial state when the command starts, and will have no effect in a running command (use SetEdgeOffGrid to alter the current setting). The argument is a boolean value which enables the flag when true.

The return value is 0 or 1 representing the previous flag state.

(int) SetRulerEdgeNonManh(non_manh)
This sets the edge snapping allow non-Manhattan flag which is applied during the Rulers command. This command has its own default edge snapping state. This function changes only the initial state when the command starts, and will have no effect in a running command (use SetEdgeNonManh to alter the current setting). The argument is a boolean value which enables the flag when true.

The return value is 0 or 1 representing the previous flag state.

(int) SetRulerEdgeWireEdge(wire_edge)
This sets the edge snapping allow wire-edge flag which is applied during the Rulers command. This command has its own default edge snapping state. This function changes only the initial state when the command starts, and will have no effect in a running command (use SetEdgeWireEdge to alter the current setting). The argument is a boolean value which enables the flag when true.

The return value is 0 or 1 representing the previous flag state.

(int) SetRulerEdgeWirePath(wire_path)
This sets the edge snapping allow wire-path flag which is applied during the Rulers command. This command has its own default edge snapping state. This function changes only the initial state when the command starts, and will have no effect in a running command (use SetEdgeWirePath to alter the current setting). The argument is a boolean value which enables the flag when true.

The return value is 0 or 1 representing the previous flag state.

(int) GetRulerSnapToGrid()
This returns the present default snap-to-grid state used during the Rulers command. The values are 0 or 1 depending on the state.

(int) GetRulerEdgeSnappingMode()
The return value is an integer 0-2 representing the default edge snapping mode to use during the Rulers command.

0 No edge snapping.
1 Edge snapping is enabled in some commands.
2 Edge snapping is always enabled.

(int) GetRulerEdgeOffGrid()
The return value is 0 or 1 depending on the setting of the edge snapping allow off-grid flag which is the default in the Rulers command.

(int) GetRulerNonManh()
The return value is 0 or 1 depending on the setting of the edge snapping allow non-Manhattan flag which is the default in the Rulers command.

(int) GetRulerEdgeWireEdge()
The return value is 0 or 1 depending on the setting of the edge snapping allow wire-edge flag which is the default in the Rulers command.

(int) GetRulerEdgeWirePath()
The return value is 0 or 1 depending on the setting of the edge snapping allow wire-path flag which is the default in the Rulers command.


next up previous contents index
Next: Grid Style Up: Main Functions 3 Previous: Main Functions 3   Contents   Index
Stephen R. Whiteley 2024-09-29