@aak194 wrote:Hi all
How can we add ( " ) inch mark to a string in autolisp
aak
Strictly speaking, you can't add anything to an existing string in AutoLISP; what you can do is create a modified copy of a string, for example by STRCAT, VL-STRING-TRANSLATE or VL-STRING-SUBST.
The actual problem here is probably that the ASCII 34 character is a string delimiter, so you need some tricks to make it a constituent character in a string.
You can either refer to it indirectly by calling a function: (chr 34), or just use in-string quotation by a backslash:
(strcat "23" (chr 34))
or
"23\""
--
Marti mentioned the strcat form, (strcat "23" (chr 34))
because that is how it is usuaslly used.
Example: your dimention is in a variable, like D1, and to print it:
(strcat (rtos D1 2 3) (chr 34))
You also could use the "\"" in the strcat.