; Permite schimbarea layer-ului curent (nu afiseaza layer-ele inghetate) ; sau transmiterea numelui unui layer catre o comada care cere nume de ; layer ("LAYER", "CHPROP" etc.) ; 1 =========================================== (defun getlco( / xx lay) (setq LLIST '()) (setq XX nil) (while (setq LAY (TBLNEXT "LAYER" XX)) (if (/= (cdr (assoc 70 lay)) 65) (progn (setq LLIST (append LLIST (list (cdr (assoc 2 LAY))))) (setq XX nil) ) (setq xx nil); avanseaza lista );end IF... ); end WHILE (IF (<= (length LLIST) (getvar "maxsort")) (setq LLIST (acad_strlsort LLIST)) );end IF );end DEFUN ; 2 ======================================= (defun layli(VALN) (set_tile "error" "") (setq LNOM (nth (atoi VALN) LLIST)) (set_tile "EDITLA" LNOM) );end DEFUN ; 3 ======================================= (defun laedit(val) (set_tile "error" "") (setq VAL (strcase VAL)) (if (member VAL LLIST) (setq LNOM VAL) (progn (set_tile "error" "Layer not available.") (mode_tile "EDITLA" 2) ) ;PROGN ) ;end IF ) ;end DEFUN ; 4 ======================================= (defun siok() (if (= (get_tile "error") "") (done_dialog 1) ) ;end IF ) ;end DEFUN ; 5 ======================================= (defun getlay ( / LLIST XX LAY VALN VAL DCLID) (GETLCO) (setq dclid (load_dialog "GETLAY.DCL")) (if (not (new_dialog "GETLAY" dclid)) (progn (alert "Fisierul GETLAY.DCL e de negasit.") (EXIT) ) ;PROGN ) ;end IF (set_tile "COUCOU" (getvar "CLAYER")) (setq LNOM (getvar "CLAYER")) (start_list "LAYLIS") (mapcar 'add_list LLIST) (end_list) (set_tile "EDITLA" (getvar "CLAYER")) (action_tile "LAYLIS" "(LAYLI $value)") (action_tile "EDITLA" "(LAEDIT $value)") (action_tile "accept" "(SIOK)") (action_tile "cancel" "(setq LNOM nil)(done_dialog 0)") (if (= (start_dialog) 1) (set_tile "EDITLA" LNOM) ) ;end IF LNOM ) ;end DEFUN ; 6 ======================================= (defun c:ch_layer() (setq oldcmdecho (getvar "cmdecho")) (setvar "cmdecho" 0) (command "layer" "s" (getlay) "") (setvar "cmdecho" oldcmdecho)(princ) ) ;end DEFUN