On click event does not works

Started by anishtain4, April 17, 2012, 10:56:53 PM

Previous topic - Next topic

anishtain4

Hi all

I have two forms and a command button in every of them to switch between. I have loaded both of them in the lisp file that is calling them at first place, when I want to go from first to second it does works perfectly with this code:
Code (autolisp) Select

(defun c:Draw_frm_Draw_cmd_blocks_OnClicked (/)
  (dcl_Form_Show Blocks_frm_Blocks)
  (dcl_Form_close Draw_frm_Draw)
  (princ)
)


but when I want to get back to frm_Draw with this code:
Code (autolisp) Select

(defun c:Blocks_frm_Blocks_cmd_Draw_OnClicked (/)
  (command "._insunits" mhjv-definsunits) ; returning insunits to default value
  (princ "this is working")  ; this line is not showing
  (dcl_Form_Show Draw_frm_Draw)
  (dcl_Form_close Blocks_frm_Blocks)
)


It just returns nil and nothing happens.

I have checked the name of this command button and it's right, there is nothing else I could think of, what is my problem?

Fred Tomke

Hi, without testing your code: do you know that AutoLisp stops executing your code at the line dcl_form_show in modal forms? See FAQ.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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