0 Members and 1 Guest are viewing this topic.
; error: quit / exit abort
(defun c:test () ;define the function (setq dcl_id (load_dialog "test.dcl")) ;load the DCL file (if (not (new_dialog "main" dcl_id)) ;load the dialog box (exit) ;if not loaded exit ) (action_tile "cancel" "(done_dialog)(setq result nil)" ) ;do this if Cancel button selected (action_tile "accept" "(done_dialog)(setq result T)" ) ;do this if OK button selected (action_tile "next" "(test1)" ) ;if Next button is selected, call ;the tested dialog function (start_dialog) ;start the dialog (unload_dialog dcl_id) ;unload the dialog (princ)) ;defun;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun test1 () ;define the function (setq dcl_id1 (load_dialog "test.dcl")) ;load the DCL file (if (not (new_dialog "test1" dcl_id1)) ;load the tested dialog box (exit) ;if not loaded exit ) (action_tile "cancel" "(done_dialog)(setq result1 nil)" ) ;if cancel selected do this (action_tile "accept" "(done_dialog)(setq result1 T)" ) ;if OK selected do this (action_tile "next" "(test2)" ) ;if Next selected call the ;second tested dialog function (start_dialog) ;start the tested dialog box (unload_dialog dcl_id1) ;unload the tested dialog box (princ)) ;defun;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun test2 () ;define the function (setq dcl_id2 (load_dialog "test.dcl")) ;load the DCL file (if (not (new_dialog "test2" dcl_id2)) ;load the second tested dialog box (exit) ;if not found exit ) (action_tile "cancel" "(done_dialog)(setq result2 nil)" ) ;do this if Cancel selected (action_tile "accept" "(done_dialog)(setq result2 T)" ) ;do this if OK selected (start_dialog) ;start the second tested dialog box (unload_dialog dcl_id2) ;unload it (princ)) ;defun;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(princ) ;load clean;|«Visual LISP© Format Options»(200 2 40 2 nil "end of " 60 9 0 0 nil T T nil T);*** DO NOT add text below the comment! ***|;
////////////////////////////////////////////////main : dialog {label = "Main Dialog";: column {: text {key = "txt1";value = "This is the main dialog box.";}: text {key = "txt2";value = "To display the next, tested dialog,";}: text {key = "txt3";value = "Press Next....";}}: row {: spacer { width = 1; }: button {label = "OK";key = "accept";width = 12;fixed_width = true;mnemonic = "O";is_default = true;}: button {label = "Next";key = "next";width = 12;fixed_width = true;mnemonic = "N";}: button {label = "Cancel";key = "cancel";width = 12;fixed_width = true;mnemonic = "C";is_cancel = true;}: spacer { width = 1;}}}////////////////////////////////////////////////test1 : dialog {label = "1st tested Dialog";: column {: text {key = "txt1";value = "This is the first tested dialog box.";}: text {key = "txt2";value = "To display the next, tested dialog, press Next";}}: row {: spacer { width = 1; }: button {label = "OK";key = "accept";width = 12;fixed_width = true;mnemonic = "O";is_default = true;}: button {label = "Next";key = "next";width = 12;fixed_width = true;mnemonic = "N";}: button {label = "Cancel";key = "cancel";width = 12;fixed_width = true;mnemonic = "C";is_cancel = true;}: spacer { width = 1;}}}////////////////////////////////////////////////test2 : dialog {label = "2nd tested Dialog";: column {: text {key = "txt1";value = "This is the last tested dialog box.";}}: row {: spacer { width = 1; }: button {label = "OK";key = "accept";width = 12;fixed_width = true;mnemonic = "O";is_default = true;}: button {label = "Cancel";key = "cancel";width = 12;fixed_width = true;mnemonic = "C";is_cancel = true;}: spacer { width = 1;}}}////////////////////////////////////////////////
you need to put your test.dcl file under autocad support path.kruuger