;Move a selection set to a specified layer. (uses USTR) ; ; AUTHOR: HENRY C. FRANCIS ; 425 N. ASHE ST. ; SOUTHERN PINES, NC 28387 ; ; All rights reserved without prejudice. ; (defun c:mtol ( / ss ssl cnt ename ent nent pic8 new8) (setq ss (ssget) ssl (sslength ss) cnt 0 );setq (if (setq pic8 (entsel "\nSelect entity on \"move to\" layer or to key-in. ")) (setq new8(cdr(assoc 8(entget(car pic8))))) (setq new8 (ustr 1 "\Enter layer name to move to. " (getvar"clayer") nil)) );if (if (tblsearch "LAYER" new8) nil (command ".layer" "m" new8 "") );if (while (< cnt ssl) (setq ename (ssname ss cnt) ent (entget ename) nent (cdr (subst (cons 8 new8) (assoc 8 ent) ent) );cdr cnt (1+ cnt) );setq (entdel ename) (entmake nent) );while (princ) );defun