;; Replace text, mtext, dim or attribute to PLOT filename
;; Based on pony.chubby routine 2016
;; Saved from here: http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/replace-text-to-filename-problem/td-p/6512932
;; Modified by Igal Averbuh 2016

(defun c:plc ()
(setq layt (getvar 'ctab))
(setq aa (strcat (vl-filename-base (getvar 'DwgName)) ".dwg"))
(setq bb (strcat (vl-filename-base (getvar 'DwgName)) "-" layt ".plt"))
(while (setq txt (car (nentsel "\n Select text, mtext, dim or attribute to replace to plot filename: ")))
(setq vla_obj (vlax-ename->vla-object txt))
(vla-put-textstring vla_obj bb)
)
;(vla-regen (vla-get-activedocument (vlax-get-acad-object)) acAllViewports)
)

Advertisements