retirement_button

jeroenberkers

Usenet Archive
Joined
Jul 16, 2003
Messages
13
Reaction score
0
I am trying to build a DCL with 2 retirement-buttons. My problem now is when I used either one, the otehr doesn't work. Any solutions?
THE CODE: (some words are in dutch, but that shouldn't be a problem...)

(defun invulwindow_ini ( / )
(setq dcl_id (load_dialog "maak_ini"))
(if (new_dialog "maak_ini" dcl_id)
(progn
(set_tile "hohmt" "1000")
(action_tile "hohmt" "(setq hoh $value)")
(action_tile "brows" "(done_dialog 2)")
(if bln
(set_tile "bldwg" bln)
) ; end if
(action_tile "endst" "(setq eindst $value)")
(if bl2
(set_tile "blknm" bl2)
) ; end if
(action_tile "blknm" "(setq bl2 $value)")
(action_tile "pckbl" "(done_dialog 4)")
(action_tile "accept" "(setq stop 0)(done_dialog 1)")
(action_tile "cancel" "(setq stop 1)(done_dialog 0)")
(setq next_step (start_dialog))
) ; end progn
(progn
(alert "Dialoogbox niet gevonden...")
(setq stop 1)
) ; end progn
) ; end if
(unload_dialog dcl_id)
) ; end defun

(defun maak_ini ( / bln bl2)
(invulwindow_ini)
(while (>= next_step 1)
(progn
(if (= next_step 2)
(progn
(setvar "FILEDIA" 1)
(setq bln (getfiled "Kies wand-block" "C:\\" "DWG" 0))
(setq next_step (invulwindow_ini))
(setvar "FILEDIA" 0)
) ; end progn
) ; end next_step 2
(if (= next_step 4)
(progn
(setq bl2 (cdr (assoc 2 (entget (car (entsel))))))
(setq next_step (invulwindow_ini))
) ; end progn
) ; end next_step 4
) ; end progn
) ; end if

(princ)
) ; end defun
 
Just a suggestion, I've found usefull.

When calling an action_tile call a subfunction to avoid confusion and use the tiles as they are numbered.

Example to use:

(defun C:example (/ dcl_id1)
(Load_default_values)
(setq dcl_id1 (load_dialog "C:\\Temp\\example.dcl"))
(if (not (new_dialog "main0" dcl_id1)) (exit))
(set_tile "edit1" edit1value)
(action_tile "edit1" "(Validate_value_edit1)")
(action_tile "list1" "(Item_list_selected)")
(start_dialog)
(unload_dialog dcl_id1)
(princ)
)

(defun Validate_value_edit1 (/)
(setq val $val)
;Do_what_ever
(princ)
)

(defun Item_list_selected (/)
(setq val $val)
;Do_what_ever
(princ)
)

(defun Load_default_values (/)
(setq edit1val <what_ever_string_value>)
;Do what ever
(princ)
)
 

Latest threads

Back
Top