First do as @Kent1Cooper said "You can't use Text for that purpose. You would need to use an Attribute."....... But I would like to mention that if you want to pass the attribute values using Lisp then you have to take care two system variables in your code ........ like.....
(defun c:WD (/ T_Rotation T_Point)
(setq Adia (getvar 'ATTDIA))
(setq Areq (getvar 'ATTREQ))
(setvar 'ATTDIA 0);;Required to feed Attribute values without a dialog box
(setvar 'ATTREQ 1);;Required to Turns on prompts or a dialog box for attribute values
(setvar 'CMDECHO 0)
(setq txt (getstring "\nYour text content for the Attribute: "))
(while (setq T_Point (getpoint "Enter the point of insertion"))
(initget 1 "Right Left Up Down")
(setq T_Rotation (getkword "\nSelect Rotation [Right/Left/Up/Down]: "))
(vl-catch-all-apply 'vl-cmdf
(list "_.insert" (strcat "BLOCK_DOUBLE_" T_Rotation) T_Point 1 1 0 txt)
)
)
(setvar 'ATTDIA Adia)
(setvar 'ATTREQ Areq)
(setvar 'CMDECHO 1)
(princ)
)
There is a question from the line.....
(vl-catch-all-apply 'vl-cmdf (list "_.insert" (strcat "*BLOCK_" "DOUBLE" "_" T_Rotation) T_Point 1 1 0))
Why do you using this "*" symbol....... to explode the block?......
If so then I would like to say that, if you "Explode" an Attributed block ....... then after "Explode" the Attribute values always replaced by the "Attribute Tag Name"...... in that case your Input Attribute Tag Value will not show in drawing......
In that case you have to use "BURST" command instead of "EXPLODE"......Like
(defun c:WD (/ T_Rotation T_Point)
(setq Adia (getvar 'ATTDIA))
(setq Areq (getvar 'ATTREQ))
(setq Pf (getvar 'PICKFIRST))
(setvar 'PICKFIRST 1)
(setvar 'ATTDIA 0);;Required to feed Attribute values without a dialog box
(setvar 'ATTREQ 1);;Required for Turns on prompts or a dialog box for attribute values
(setvar 'CMDECHO 0)
(setq txt (getstring "\nYour text content for the Attribute: "))
(while (setq T_Point (getpoint "Enter the point of insertion"))
(initget 1 "Right Left Up Down")
(setq T_Rotation (getkword "\nSelect Rotation [Right/Left/Up/Down]: "))
(vl-catch-all-apply 'vl-cmdf
(list "_.insert" (strcat "BLOCK_DOUBLE_" T_Rotation) T_Point 1 1 0 txt)
)
(sssetfirst nil (ssget "L"))
(C:BURST)
)
(setvar 'PICKFIRST Pf)
(setvar 'ATTDIA Adia)
(setvar 'ATTREQ Areq)
(setvar 'CMDECHO 1)
(princ)
)
But the Main thing ......All the above code is valid only for Single Attributed Block......Like ..... go through the attachment........
Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....