- (vl-load-com)
- (defun C:T0603( / FilePath FFile FLine TextList MS 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了 |