12-01-2015
08:57 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
12-01-2015
08:57 AM
Convert Text to Attribute
I have a title block which is made up of two rows of single line text and I would like to convert these to being a block with attributes. Is there a command to convert the single line text to an attribute?
David P
AutoCAD 2021
AutoCAD 2021
12-01-2015
09:12 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
12-01-2015
09:12 AM
Welcome to this forum.
No, there is no command to convert text to an attribute.
You will have to use the ATTDEF command and create the attribute definitions.
12-01-2015
10:20 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
12-01-2015
10:20 AM
Try this [minimally tested]:
(defun C:T2A (/ tss tent tdata txt); = Text (To) Attribute
(prompt "\nTo convert Text object(s) to Attribute definition(s),")
(if (setq tss (ssget '((0 . "TEXT"))))
(repeat (setq n (sslength tss)); then
(setq
tent (ssname tss (setq n (1- n)))
tdata (entget tent)
txt (cdr (assoc 1 tdata)); text content to use as both Tag and Prompt
); setq
(entmake
(append
'((0 . "ATTDEF")); new entity type
(vl-remove-if '(lambda (x) (member (car x) '(-1 0 330 5 100 1))) tdata)
; everything common between both kinds [except expendable 100 entries]
(list '(1 . "") (cons 3 txt) (cons 2 txt) '(70 . 0) '(74 . 0))
; 1 entry different in ATTDEF from TEXT; others in ATTDEF but not in TEXT
); append
); entmake
(entdel tent); eliminate original Text object
); repeat
); if
(princ)
); defun
Kent Cooper, AIA
09-20-2020
05:23 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
09-20-2020
05:23 AM
There is an add-in on the Autodesk App Store for AutoCAD 2021. It's names Text To Attribute 2021. It also works with all the AutoCAD 2021 verticals.