(defun c:tt (/ e ee i ms p s xx)
(if (setq s (ssget '((0 . "INSERT"))))
(progn
(setq ms (vla-get-modelSpace (vla-get-ActiveDocument (vlax-get-acad-object))))
(setq i -1)
(while (setq e (ssname s (setq i (1+ i))))
(if (and (setq e (vlax-ename->vla-object e))
(vla-get-HasAttributes e)
(setq p (vla-get-InsertionPoint e))
(setq ee (vlax-safearray->list (vlax-variant-value (vla-GetAttributes e))))
)
(foreach x ee
(if (and (= "A" (vla-Get-TagString x))
(setq xx (vla-Get-TextString x))
(read xx)
)
(vla-Move(vla-AddText ms xx p 300) (vlax-3D-point 0 0 0)(vlax-3D-point 300 0 0))
)
)
)
)
)
)
) 波总的代码记录一下