[讨论] 关于图层的隔离!!!
<p><strong><font color="#ff0000">关于图层的隔离,即选择图元后,被选择图元所在的层保持开的状态,别的图层关闭。现在下面的 lisp有个问题,不管选择一个层上的图元还是多个层上的图元,结果都只能隔离一个图层,不能隔离多个图层,希望高手能帮着改一下!!!谢谢!!!</font></strong></p><p><strong><font color="#ff0000"></font></strong> </p>
<p><strong><font face="Verdana" color="#000000">(defun c:ee (/ ent entlist lname selent m)<br/> (setq selent(ssget) m -1)<br/> (while (< (setq m(1+ m)) (sslength selent))<br/> (setq entlist (entget (ssname selent m)))<br/> (setq lname (cdr(assoc 8 entlist)))<br/> (command "layer" "off" "*" "y" "on" lname "")<br/> ) <br/>) </font></strong></p> <p><strong><font color="#ff0000">另外感觉这个lisp不是很完美,希望高手能写一个完美的。感激不尽!!!</font></strong></p> <p><font face="Verdana">(defun c:lo()<br/> (setvar "cmdecho" 0)<br/> (setq sels (ssget) )<br/> (if sels (lomain) )<br/>(princ)<br/>)</font></p>
<p><font face="Verdana">(defun lomain()<br/> (setq n (sslength sels) )<br/> (setq llist '() )<br/> (repeat n<br/> (setq a (ssname sels (setq n (1- n))) )<br/> (setq b (cdr (assoc 8 (entget a))) )<br/> (if (member b llist)<br/> ()<br/> (setq llist (cons b llist) )<br/> )<br/> )<br/> )<br/> (if (member (getvar "clayer") llist)<br/> ()<br/> (setvar "clayer" (setq lay (last llist)))<br/> )</font></p>
<p><font face="Verdana"> (command "layer" "off" "*" "y")<br/> (foreach x llist (command "on" x))<br/> (command "")<br/>)</font></p> 这个好简单哦 留个记号,好贴 插【实用的
页:
[1]