shutting down all controls

Started by potencjalek, October 25, 2013, 11:46:26 PM

Previous topic - Next topic

potencjalek

Hi
In my application I have 8 different bar controls
i want to shut  down all controlls while changing drawings
so I created function which egzamine whether bar is open and if yes shut it down, code below

(defun zamknij_wszystkie_karty       ()      
(if (dcl_Form_IsActive KalkulatorTMZ_DodajGS)                  (dcl_form_Close KalkulatorTMZ_DodajGS)                  )
(if (dcl_Form_IsActive KalkulatorTMZ_KalkulatorTMZ)               (dcl_form_Close KalkulatorTMZ_KalkulatorTMZ)               )
(if (dcl_Form_IsActive KalkulatorTMZ_MacierzStrumieni)               (dcl_form_Close KalkulatorTMZ_MacierzStrumieni)               )
(if (dcl_Form_IsActive KalkulatorTMZ_TMZ)                     (dcl_form_Close KalkulatorTMZ_TMZ)                     )
(if (dcl_Form_IsActive KalkulatorTMZ_Ustawienia)                  (dcl_form_Close KalkulatorTMZ_Ustawienia)                  )
(if (dcl_Form_IsActive KalkulatorTMZ_UstawieniaAutomatyczneStrumieni)   (dcl_form_Close KalkulatorTMZ_UstawieniaAutomatyczneStrumieni)   )
(if (dcl_Form_IsActive KalkulatorTMZ_UstawieniaStrumieni)            (dcl_form_Close KalkulatorTMZ_UstawieniaStrumieni)            )
(if (dcl_Form_IsActive KalkulatorTMZ_RysowanieStrumieni)            (dcl_form_Close KalkulatorTMZ_RysowanieStrumieni)            )
)

and i run it while "OnDocActivated" of every control bar
while changing drawings bricscad returns that there is no function definition
f.e.
error : no function definition <C:KALKULATORTMZ_KALKULATORTMZ_ONDOCACTIVATED> ; expected FUNCTION at [EVAL]
does it mean that i have to load all definition to newly opened drawings (using for example on_doc_load.lsp)?

Fred Tomke

Hi, potencjalek,

Quotedoes it mean that i have to load all definition to newly opened drawings

Yes, it does. I recommend you to use a .mnl-file (if you use to have a menu) or a acaddoc.lsp.

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

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