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