(defun c:tt (/ d r ss n obj atts)
(while (setq d (tblnext "BLOCK" (null d)))
(setq r (cons (cdr (assoc 2 d)) r))
)
(and r (setq filename (getfiled "属性输出文件名" "" "csv" 1)))
(if filename
(progn
(setq f (open filename "w"))
(foreach name r
(setq ss (ssget "X" (list '(0 . "INSERT")(cons 2 name)'(8 . "KX-目录")'(66 . 1))));选择KX-目录图层