dpf200810 发表于 2018-4-3 16:23:00

CAD逐条添加文本

运用小程序需要安装Microsoft .NET Framework4.0



**** Hidden Message *****

yangchao2005090 发表于 2019-6-2 18:22:00

正好用的到,不过要是lsp就好了

guohq 发表于 2019-6-3 00:14:00

(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了

cairunbin 发表于 2019-6-3 14:42:00


给你点个赞!超级快速反应啊。
页: [1]
查看完整版本: CAD逐条添加文本