Re-open a modal dialog

Started by borsa · 2011-12-22 10:12 UTC · 2 replies · SMF topic #1738

Hello Again, I am trying to open, close, and open again a Modal dialogs

I have two dialogs :
Form1 with a button to close itself and open Form2
Form2 with a button to close itself and open Form1

From form1 to form2 the program is ok but from form2 to form1 the program close form2 as cancell (return 2) and don`t open form1.

I've atached the lisp and odcl files to test them if you want.

Whas is wrong?

thanks for your help.
Attachments
Hi,

make it as written in the {2}: there I've shown how to get access to AutoCAD after closing a form. It is similar to your question: make an outer while-loop and an inner while-loop for your forms. Make sure that you've complete left the event functions which closes the form before showing the next (don't leave the car before stopping it).

A simple sample:

(defun c:mycommand ()
  (defun c:form1ok ()
    (dcl_form_close form1 1)
  ); c:form1ok

  (defun c:form2ok ()
    (dcl_form_close form2 1)
  ); c:form2ok

  (while (and (= (dcl_form_show form1) 1)  (= (dcl_form_show form2) 1))
); c:mycommand

Regards, Fred
Hello

To fix the question i did it a while-loop as in the file attached and works prefectly.

thanks for your help

Attachments