请教如何取得图层列表及相应的颜色与线型列表
<P>请教如何取得图层列表及相应的颜色与线型列表</P><P>这是BDY老大的取得图层列表的LISP</P>
<P>(defun Get-Laylist-BDY (/ DOC LAY-L LAYS)<BR> (setq doc (vla-get-activedocument (vlax-get-Acad-Object)))<BR> (setq lays (vla-get-layers doc))<BR> (vlax-for item lays<BR> (SETQ LAY-L (APPEND LAY-L (LIST (vla-get-Name item))))<BR> )<BR>)</P> 取得图层名后,使用(cdr (assoc 62 (tblsearch "layer" layname)))获得颜色,,同样,组码6是线形 (defun c:test (/ s1 la co lt lst)
(setq s1 (tblnext "layer" T)
la(tbl 2 s1)
co(tbl 62 s1)
lt(tbl 6 s1)
lst (cons (list la co lt) lst)
)
(while (setq s1 (tblnext "layer" nil))
(setq la(tbl 2 s1)
co(tbl 62 s1)
lt(tbl 6 s1)
lst (cons (list la co lt) lst)
)
)
(princ"\n层 颜色 线型列表 : ")
(princ"\n")
lst
)
(defun tbl (mode ent)
(cdr (assoc mode ent))
) 感谢大佬分享
页:
[1]