检查图层创建图层
怎样用Lisp检查图中有没有某图层然后把某图元挪到该图层,或在没有该图层的情况下创建此图层然后再........ ;判断有没有aaa这个层(defun test ( / ss)<BR> (setq ss (ssget))<BR> (if (/= (tblsearch "layer" "aaa") nil)<BR> (command "change" ss "" "p" "la" "aaa" "")<BR> (progn<BR> (command "-layer" "n" "aaa" "")<BR> (command "change" ss "" "p" "la" "aaa" "")<BR> )<BR> )<BR>) 简洁明了啊,如果搂住不熟悉符号表也可用选择集过滤
(defun test ( / ss)<BR>(setq ss (ssget "x" '(8."aaa")))
(if (/= ss nil)<BR> (command "change" ss "" "p" "la" "aaa" "")<BR> (progn<BR> (command "-layer" "n" "aaa" "")<BR> (command "change" ss "" "p" "la" "aaa" "")<BR> )<BR> )<BR>) 新手学习,留个脚印。
页:
[1]