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.
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.
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.