|
求高手赐一个能将图幅中文字(包含属性块中的文字)提取到text或excel中的小插件。
我自己已有提取图幅中普通文字到text或excel的小插件,但是属性块中的始终无法实现,我先抛砖引玉了:
(defun C:wf(/ test fil ss len n en1 a oldt nn)
(setvar "CMDECHO" 0)
(setq test T nn 0)
(setq fil (getstring "\nFile name: "))
(setq f (open fil "w"))
(while test
(setq ss (ssadd))
(setq ss (ssget))
(if (= nil ss)
(setq test nil)
(progn
(setq len (sslength ss))
(setq n 1 s 1)
(while (<= n len)
(setq en1 (ssname ss (1- n)))
(setq a (entget en1))
(if (= "TEXT" (cdr (assoc 0 a)))
(progn
(setq oldt (cdr (assoc 1 a)))
(write-line oldt f)
(setq nn (1+ nn))
)
)
(setq n (1+ n))
)
)
)
)
(close f)
(princ (strcat (itoa nn) " writed !"))
(princ)
)
|
|