Command line: T2SCR

Ribbonbar: ProSig EPU -> Tools -> Services -> Run Text as Script


The function 'Run Text as Script' serves the quick, convenient execution of frequent sequences of commands as so-called scripts (helpful, for example, in plot command sequences). To make it happen, the user first has to take his or her current drawing and generate one or more temporary or permanent text lines (via TEXT or DTEXT command) in it that contain the desired commands. Once activating the RUN TEXT AS SCRIPT function, the user is then prompted to pick the relevant command texts to execute.

 

The user can pick his or her desired texts in any order or select them using the window option. The RUN TEXT AS SCRIPT function sorts the selected texts based on the y-coordinates of their insertion points in the current coordinate system (WKS or BKS), so that the commands are written into the script file in the order 'from top left to bottom right' and subsequently processed in that order (i.e., they are sorted in descending order based on the size of their y-coordinates).

After executing the command, the function turns to the temporary directory, where it generates the script file TEMP.SCR from the picked commands, executing it once.

Note: Aside from user-defined commands, the script file TEMP.SCR further contains program commands serving the program sequence control of the script file:

The value of system variable FILEDIA is set on 0 to prevent the script sequence from being interrupted by file selection dialog boxes.

The value of system variable CMDDIA is set on 0 to prevent the script sequence from being interrupted by dialog boxes prompted by plot commands and external database commands.

The value of system variable REGENMODE is set on 0 to prevent the script sequence from being interrupted by the regenerate message prompted by commands, in which AutoCAD requires a regenerate to update drawings, and instead to generate the message "Regen set on queue". REGENMODE = 0 deactivates REGENAUTO to initiate the aforesaid AutoCAD reaction.

If the user selects a command text, whose contents are faulty to the point where it cannot be correctly processed by AutoCAD, then AutoCAD aborts execution of the script at this point, issuing a corresponding error message. At this point, it is important to remember that the system variables FILEDIA, CMDDIA and REGENMODE will all have their original values replaced by the value 0, as restoration of the original values of these variables was aborted along with the command abort.

Beginning with AutoCAD 2000 and AutoCAD Map 2000, layer names, text styles, etc., may include empty spaces or special characters. In that case, certain commands may no longer be explicit.

 

Example: A text like "-LAYER SE 0 EI 423113" may be interpreted, among others, as follows:

Set layer "0", activate layer 423113, or

Set layer "0 EI 423113".

Any names containing empty spaces must be correctly put in brackets in the form of quotes.

 
Example: LAYER SE "0" EI "423113" or

LAYER SE "0 EI 423113"

This is not required for names containing no empty spaces.