just a quicky (before my boss finds out)
; choose from list
(defun cfl (l / f p d r)
(and (setq p (open (setq f (vl-filename-mktemp ".dcl")) "w"))
(princ "cfl:dialog{label=\"Choose\";:list_box{key=\"lb\";}ok_cancel;}" p)
(not (setq p (close p)))(< 0 (setq d (load_dialog f)))(new_dialog "cfl" d)
(progn
(start_list "lb")(mapcar 'add_list l)(end_list)
(action_tile "lb" "(setq r (nth (atoi $value) l))(done_dialog 1)")
(action_tile "accept" "(setq r (get_tile \"lb\"))(done_dialog 1)")
(action_tile "cancel" "(setq r nil)(done_dialog 0)")
(start_dialog)(unload_dialog d)(vl-file-delete f)
)
)
(cond ((= r "") nil)(r r)(t nil))
)
(defun c:t1 ( / lay-list)
(setq lay-list '("layer1" "layer2" "layer3"))
(if (setq inp (cfl lay-list)) (alert (strcat "You selected " inp))(alert "You cancelled"))
(princ)
)