Re-open a modal dialog

Started by borsa, December 22, 2011, 02:12:30 AM

Previous topic - Next topic

borsa

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.

Fred Tomke

Hi,

make it as written in the FAQ: 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:

Code (autolisp) Select
(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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

borsa

Hello

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

thanks for your help