Please optimize the source code

Started by tipsess, October 14, 2015, 05:08:21 PM

Previous topic - Next topic

tipsess

Please optimize the source code

Code (autolisp) Select


(defun c:dkgsm_text_change_CheckBox1_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox1 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox1 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox2_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox2 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox2 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox3_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox3 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox3 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox4_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox4 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox4 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox5_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox5 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox5 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox6_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox6 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox6 nil)
  );if
)
(defun c:dkgsm_text_change_CheckBox7_OnClicked (Value /)
  (if (/= Value 0)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox7 T)
(dcl_Control_SetEnabled dkgsm_text_change_TextBox7 nil)
  );if
)



Fred Tomke

Hi, can explain in some more words how I can help you. Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

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

owenwengerd

Are you looking for this?
Code (autolisp) Select
(defun c:dkgsm_text_change_CheckBox1_OnClicked (Value /)
  (dcl_Control_SetEnabled dkgsm_text_change_TextBox1 (/= Value 0))
)
Owen Wengerd (Outside The Box) / ManuSoft

tipsess

I wish the event delegate type thing.
Thank you, though.