select layout, thanx dialog from Lee
(defun c:xx (/ p1 p2 ss)
(vl-load-com)
;; http://www.lee-mac.com/listbox.html
;; List Box - Lee Mac
;; Displays a DCL list box allowing the user to make a selection from the supplied data.
;; msg - [str] Dialog label
;; lst - [lst] List of strings to display
;; bit - [int] 1=allow multiple; 2=return indexes
;; Returns: [lst] List of selected items/indexes, else nil
(defun LM:listbox (msg lst bit / dch des tmp rtn)
(cond
((not
(and
(setq tmp (vl-filename-mktemp nil nil ".dcl"))
(setq des (open tmp "w"))
(write-line
(strcat "listbox:dialog{label=\""
msg
"\";spacer;:list_box{key=\"list\";multiple_select="
(if (= 1 (logand 1 bit))
"true"
"false"
)
";width=50;height=15;}spacer;ok_cancel;}"
)
des
)
(not (close des))
(< 0 (setq dch (load_dialog tmp)))
(new_dialog "listbox" dch)
)
)
(prompt "\nError Loading List Box Dialog.")
)
(t
(start_list "list")
(foreach itm lst (add_list itm))
(end_list)
(setq rtn (set_tile "list" "0"))
(action_tile "list" "(setq rtn $value)")
(setq rtn
(if (= 1 (start_dialog))
(if (= 2 (logand 2 bit))
(read (strcat "(" rtn ")"))
(mapcar '(lambda (x) (nth x lst)) (read (strcat "(" rtn ")")))
)
)
)
)
)
(if (< 0 dch)
(unload_dialog dch)
)
(if (and tmp (setq tmp (findfile tmp)))
(vl-file-delete tmp)
)
rtn
)
(setq layouts (LM:listbox "Select Layouts to modify... " (layoutlist) 1))
(vl-load-com)
(if (and (= 0 (getvar 'tilemode))
(setq p1 (getpoint "\nSpecify first corner point: "))
(setq p2 (getcorner p1 "\nSpecify other corner point: "))
)
(foreach tab layouts
(setvar 'ctab tab)
(and (= 1 (getvar 'cvport)) (vlax-invoke (vlax-get-acad-object) 'zoomwindow p1 p2))
(if (setq ss (ssget "W" p1 p2 (list (cons 410 tab))))
(mapcar 'entdel (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
)
)
)
(princ)
)