(defun c:golay (/ lname llist lglist list_pos cd aklay tem_el ak_ls new_lay iv) (setq cd (getvar "cmdecho")) (setvar "cmdecho" 0) (setq lname nil llist (dictsearch (namedobjdict) "ACAD_LAYOUT") lglist (length llist) list_pos lglist aklay (getvar "ctab") tem_el 0 ) ;_ end of setq (while (>= list_pos 0) (If (= (car (nth list_pos llist)) 3) (progn (setq lname (cons (cdr (nth list_pos llist)) lname))) ) ;_ end of If (setq list_pos (- list_pos 1)) ) ;_ end of while (setq lglay (length lname)) (while (< tem_el lglay) (if (= (nth tem_el lname) aklay) (setq ak_ls tem_el) ) ;_ end of if (setq tem_el (+ tem_el 1)) ) ;_ end of if (if (> (setq iv (load_dialog "golay")) 0) (progn (if (new_dialog "golay" iv) (progn (defun checkit () (setq new_lay (get_tile "dcl_list")) new_lay ) ;_ end of defun (start_list "dcl_list") (mapcar 'add_list lname) (end_list) (set_tile "dcl_list" (itoa ak_ls)) (action_tile "accept" "(if (setq new_lay (checkit)) (done_dialog 1))" ) ;_ end of action_tile (action_tile "cancel" "(done_dialog 0)") (setq flag (start_dialog)) ) ;_ end of progn (alert "Unable to display dialog box") ) ;_ end of if (unload_dialog iv) ) ;_ end of progn (alert "Unable to load dialog box") ) ;_ end of if (if (= new_lay nil) (progn (command "ctab" aklay)) (progn (command "ctab" (nth (atoi new_lay) lname)))) (setvar "cmdecho" cd) (princ) )