AutoLISP将外部文件中的文字写入图形
2011-03-29 17:00 精诚所至 金石为开 阅读(696) 评论(0) 编辑 收藏 举报AutoLISP将外部文件中的文字写入图形,代码如下。
(defun c:test()
(setvar "cmdecho" 0)
(setq ffn (getfiled "选择文件" "" "txt" 2))
(setq pt (getpoint "\n选取文字插入点:"))
(setq hh (getdist pt "\n字高:"))
(setq ff (open ffn "r"))
(setq data (read-line ff))
(command "text" pt hh 0 data)
(setq data (read-line ff))
(while data
(command "text" "" data)
(setq data (read-line ff))
)
(close ff)
(prin1)
)
代码完。
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)