Uses of Batch Files
Home > 10 Files > Uses of Batch Files
Uses of Batch Files
You can use a batch file:
To perform repetitive actions that you frequently need—for example, setting customized text, dimension and line attributes at the beginning of every ARC+ session
To program time-consuming sequences of commands for unattended or overnight execution e.g. opening a sequence of files, converting each to a series of solid views, and saving each view as a two-dimensional projection.
To program a sequence of ARC+ commands for use in a presentation
You can prepare a batch file:
By recording an ARC+ work session automatically.
By creating or editing, a file of ARC+ commands using an ASCII editor.
You can combine the two methods by editing a file that was recorded in a work session.
To use a batch file, it must be stored in the current directory of your disk and have a filename with the extension log.
The following is an example of a batch file that opens a model called MODEL3D, sets the view, and saves the view in a two-dimensional file called MODEL2D.
\open modele3d
\eye 15 4 25
\targ 0 0 0
\solid w 1
\save2d modele2d n
Each command starts on a new line but may continue on succeeding lines. Commands are typed in lower case letters and include all relevant parameters (responses to screen prompts).
Commands permitted in a Batch File
The following commands and operations may be included in a batch:
Menu commands and options
Mouse operations — choosing commands and options, confirming or rejecting command actions, defining points and indicating entities
Keyboard commands
Typing responses to command prompts on the input line
Hotkey
Other batch files (batch within a batch), up to a hierarchy of ten levels
While recording a batch file, if you define a point using the mouse, the system records the absolute xyz coordinates of the point. When you later execute the batch file, the mouse operation is performed at the same xyz coordinates, as illustrated in the Eye (\eye) and Target (\targ) commands of the above example.
If you indicate an entity using the mouse, the system records the entity on which the operation was performed. When you execute the batch file, the operation is performed on the same entity. This is useful only if you intend to replay the batch file on the same model (e.g., in a demonstration or presentation). If you execute the batch file on another model, an incorrect or nonexistent entity may be indicated.
When you record a batch file, you can set a time delay for replay of successive commands. This is useful to slow down the replay for use in a presentation.
HINT If you intend to execute the batch file on another model, choose commands that operate on a selection group of entities rather than indicating entities with the mouse.
The following functions are not permitted in batch files:
Dialog boxes (type on the input line instead)
Opening, closing, moving or resizing a window
Changing the active window
Saving or loading a screen configuration
Dragging the eye or target in a view control window
Dragging the fence in a zoom control window
Non-ARC+ commands, such as cut and paste, that appear in the ARC+ menus on some computer systems.