;;; TOLAYER.LSP - KETIV ;;; ;;; KETIV Technologies, Inc. ;;; 6645 NE 78th Court #C2 ;;; Portland, OR 97218 ;;; ;;; Layer Group: None ;;; ;;; Menu Location: Edit1 pull down ;;; ;;; Purpose: To move selected entities to the current layer ;;; ;;; Prompts: ;;; Select objects: ;;; Destination layer : ;;; [If the layer does not exist] ;;; Layer "name" does not exist." ;;; ;;; Assumptions/Limitations: NONE ;;; ;;;====================================================================================================== ;;; Initialize memory and important system variables ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 1986, 1987, 1988, 1989 by KETIV Technologies, Inc. ;;;> EDITED: 09-04-2006 ;;; (defun c:tolayer (/ layer ss1 test) (setq clayer nil) (setvar "cmdecho" 0) ;====================================================================================================== ; Pick entities to move to the current layer (setq ss1 (ssget)) (while (progn (setq layer (strcase (getstring (strcat "\nDestination layer <" (getvar "clayer") ">: ") ) ) ) (if (= layer "") (setq layer (getvar "clayer"))) (setq test (tblsearch "layer" layer)) (if (null test) (progn (setq test "Yes") ;;; (substr ;;; (strcase ;;; (getstring ;;; (strcat "\nLayer " layer " does not exist. Create it : ") ;;; ) ;;; ) 1 1 ;;; ) ;;; ) (if (= test "N") (setq test nil) (command ".layer" "n" layer "") ) ) ) (null test) ) ) ; ;================================================================================================== ; Change entities (command ".chprop" ss1 "" "la" layer "") ; ;================================================================================================== ; Reset the atomlist (princ) )