PDA

View Full Version : 2016 Attributes



tim_newsome
2017-09-14, 01:26 PM
Is there a way to convert existing text into a text attribute?

rkmcswain
2017-09-14, 02:35 PM
Take a look: https://forums.autodesk.com/t5/autocad-architecture-forum/convert-text-to-attribute/td-p/2533462

cad2018
2017-09-21, 07:52 PM
use command tt2


(defun c:tt2 (/ ss i en ed)
(while (not ss)
(princ "\nSelect TEXT to Convert to ATTDEF: ")
(setq ss (ssget (list (cons 0 "TEXT")
(if (getvar "CTAB")
(cons 410 (getvar "CTAB"))
(cons 67 (- 1 (getvar "TILEMODE"))))))))

(setq i (sslength ss))
(while (not (minusp (setq i (1- i))))
(setq en (ssname ss i)
ed (entget en))
(if (wcmatch (cdr (assoc 1 ed)) "* *")
(alert "\nString Contains Spaces - Try Again...")
(progn
(entmake (list (cons 0 "ATTDEF")
(assoc 8 ed)
(assoc 10 ed)
(assoc 11 ed)
(assoc 7 ed)
(assoc 40 ed)
(assoc 41 ed)
(assoc 50 ed)
(assoc 51 ed)
(cons 70 0)
(assoc 71 ed)
(assoc 72 ed)
(cons 74 (cdr (assoc 73 ed)))
(assoc 210 ed)
(cons 1 "")
(cons 2 (cdr (assoc 1 ed)))
(cons 3 (cdr (assoc 1 ed)))
(if (assoc 6 ed) (assoc 6 ed)'(6 . "BYLAYER"))
(if (assoc 39 ed) (assoc 39 ed)'(39 . 0))
(if (assoc 62 ed) (assoc 62 ed)'(62 . 256))))
(entdel en))))
(redraw)
(prin1))