To make things complicated
(defun c:DemonstrationOfChangingTextToAttribute
(/ selectionset
increment TheSelectedTextObject
dataFromSelectedTextObject
)
(if (and
(tblsearch "BLOCK" "Line code")
(setq selectionset (ssget "_:L" '((0 . "TEXT"))))
)
(repeat (setq increment (sslength selectionset))
(setq TheSelectedTextObject
(ssname selectionset
(setq increment (1- increment))
)
)
(setq dataFromSelectedTextObject (entget TheSelectedTextObject))
(setq dataIneedFromSelectedTextObject
(mapcar
(function
(lambda (dxfcodes)
(assoc
dxfcodes
dataFromSelectedTextObject
)
)
)
'(1 40 7 10 50 41 8)
)
)
(entmake
(append
(list '(0 . "INSERT")
'(66 . 1)
'(2 . "Line code")
)
(cdddr dataIneedFromSelectedTextObject)
)
)
(entmake
(append
(list
'(0 . "ATTRIB")
'(2 . "LINE_CODE")
'(70 . 0)
)
dataIneedFromSelectedTextObject
)
)
(entmake '((0 . "SEQEND")))
(entdel TheSelectedTextObject)
)
)
(princ)
)