如何用autolisp提取cad文件中的所有文字样式,并将文字样式名罗列出来?

如题所述

(defun get-textstyle ( )
(if (null vlax-dump-object) (vl-load-com) )
(setq txts (vla-get-textstyles (vla-get-activedocument (vlax-get-acad-object))))
(setq txtl '())
(vlax-for txt txts
(setq txtl (cons (vla-get-name txt) txtl))
)
(reverse txtl)
)

;;函数(get-textstyle)返回的值就是当前图档中包含的所有文字样式的表
温馨提示:答案为网友推荐,仅供参考
第1个回答  2020-09-27
;;获取当前图档中所有文字样式的列表
;;(get-style)
(defun get-style ( / list-sty key data-sty name-sty)
(setq list-sty nil)
(setq key T)
(while (setq data-sty (tblnext "style" key))
(setq name-sty (cdr (assoc 2 data-sty)))
(setq list-sty (cons name-sty list-sty))
(setq key nil)
)
(reverse list-sty)
)
相似回答