About Functions Restricted When a Dialog Box is Open (DCL)

While a dialog box is active—that is, during the start_dialog call—you cannot call any function that requires user input on the AutoCAD command line, or affects the display outside the dialog box (for example, in the graphics window). This restriction includes functions that write text, such as print, princ, and prin1.

Note: DCL support in AutoLISP is limited to Windows only.

You can issue ssget calls, as long as you do not use any options that require user input. If your program calls one of the restricted functions between the start_dialog and done_dialog calls, AutoCAD terminates all dialog boxes and displays the following error message:

AutoCAD rejected function

You can test the CMDACTIVE system variable to determine if a dialog box is active. If CMDACTIVE is greater than 7, a dialog box is active. The CMDACTIVE system variable has bit-coded values that indicate command, script, and dialog box activity.

Note: If your application requires users to enter input based on the graphics screen rather than on the dialog box itself (for example, to specify a point or select an object), you must hide the dialog box. That is, you must call done_dialog so the graphics screen is visible again, and then restart the dialog box after the user has made the selection.

The term_dialog function terminates all current dialog boxes as if the user had canceled each of them. This function can be used to cancel a series of nested dialog boxes.