PDA

View Full Version : Inserting text Via Lisp


Borg
2005-01-31, 09:09 PM
This should be an easy one for me but I can't seem to figure it out.
I expect the code below to insert the following note.

"NOTE: THIS DRAWING WAS
FORMERLY IDENTIFIED AS
LDAR-XXX"

(command "text" "s" "romand" "17.125,5.375" 0.1875 0
(strcat "NOTE: THIS DRAWING WAS""\nFORMERLY IDENTIFIED AS" "\n "
(vl-string-right-trim ".DWG" (getvar "DWGNAME"))))

What I get is this:

"NOTE: THIS DRAWING WAS
FORMERLY IDENTIFIED AS
LDAR-XXX"

I tried using the "\r" instead of, and in addition to the "\t", but
all that produces is a question mark.

What's up?
Thanks

RobertB
2005-01-31, 11:41 PM
The "\n" has no context in the Text command.

(command "._Text"
"_S"
"RomanD"
"17.125,5.375"
0.1875
0
"NOTE: THIS DRAWING WAS"
"._Text" ; start text command again
"" ; start text next line down
"FORMERLY IDENTIFIED AS"
"._Text" ; start text command again
"" ; start text next line down
(vl-Filename-Base (getvar "DWGNAME")))

Tom Beauford
2005-02-01, 09:21 PM
What you need is "vla-addMText".

Take a look at the website: http://intervision.hjem.wanadoo.dk/vla/addmtext.htm

then as you enter the text use "\P (file://P/)" for return.
ex.
NOTE: THIS DRAWING WAS\P (file://P/)FORMERLY IDENTIFIED AS\P (file://P/)LDAR-XXX