CAD逐条添加文本
运用小程序需要安装Microsoft .NET Framework4.0**** Hidden Message ***** 正好用的到,不过要是lsp就好了 (vl-load-com)
(defun C:T0603( / FilePath FFile FLine TextListMS Index InsertPt)
(setq FilePath (getfiled "选择待标注的文件" "" "" 8))
(if (null FilePath)
(exit)
)
(setq FFile (open FilePath "r") TextList '())
(setq FLine (read-line FFile))
(while FLine
(setq TextList (cons FLine TextList))
(setq FLine (read-line FFile))
)
(close FFile)
(setq TextList (reverse TextList));反向
(setq MS (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setq Index 0)
(repeat (length TextList)
(setq FLine (nth Index TextList) Index (1+ Index))
(setq InsertPt (getpoint "\n拾取插入点"))
(if InsertPt
(vla-addtext MS FLine (vlax-3d-point InsertPt) 2)
)
)
(prin1)
)
好久没有写LISP了
给你点个赞!超级快速反应啊。
页:
[1]