Free AutoLisp Routine (Text Transfer)
1,905 viewsI think it is safe to say that, most of the advance AutoCAD users, knows how to use AutoLisp, they might even know how to do a routine by themselves as well. Just like some of my colleagues, back in the previous company that I’ve been work with. Some of my colleagues there are AutoLisp fanatics, they even develop an AutoLisp routine of their own. And I can even say that I know how to do a AutoLisp routine, albeit not that complex as some of my colleagues does.
Well, anyway I just like to share an AutoLisp routine that my colleagues shared with us back then. This routine called Text Transfer.
Text Transfer is an AutoLisp routine, that will allow you to copy a series of text content to one place to another. You’ll just have to select the text content that you want to be copied and transfer it to another location, by clicking the text on the selected location or the text you want to replace.
Copy the set of text below and save it to notepad, but make sure that you put (.lsp) as your file extension, or it wont work, then save it and put it on a folder that you can easily remember.
Text Transfer Lisp
(defun c:tt ( / A B)
(setq A (cdr (assoc 1 (entget (car (entsel “Select TEXT to be TRANSFER: “))))))
(while (setq B (car (entsel “Select TEXT item to be REPLACE: “)))
(setq C (entget B))
(entmod (subst (cons 1 A)(assoc 1 C)C))
(if (or (= (cdr (assoc 0 C)) “POLYLINE”)(= (cdr (assoc 0 C)) “INSERT”))
(entupd B)))
(princ))

Then, at the command prompt, type APPLOAD, then a dialogue box will pop, then frome there select the routine that you saved, then click the Load button. then you’re all set.
At the command prompt, type Text Transfer or TT, then select the text to be transfer, after selecting, select text item to be replace. Then voila!!…






















April 24th, 2009 at 6:45 pm |
Hi,
I tried it but once I loaded it and type TT it says
Command: tt Unknown command “TT”. Press F1 for help.
Any clues why this is not working?
April 27th, 2009 at 3:48 pm |
hi you have to upload it first to your autocad, before it works. Try to copy the set of text that I qouted, then put .lsp as extension file.
May 2nd, 2009 at 6:30 am |
I was able to upload- but when i execute the command- it says “too many arguments”.. what do you think is the problem? thanks
May 10th, 2009 at 11:51 pm |
It says ” too many arguments”. There might be something wrong with the syntax.
May 12th, 2009 at 1:47 am |
@jr and onzki
I just check it and tried many times and i dnt see any prblems at all?
May 19th, 2009 at 4:48 am |
after copying the routine from this page, paste it to notepad and then retype quatation marks from (“) to (”), ACAD doesn’t recognize the mark “, instead use “..
May 21st, 2009 at 9:15 am |
Thanks for sharing this autolisp. Will it work on autocad 2000?
May 21st, 2009 at 3:07 pm |
@cadblog
I think it will work in autocad 2000
June 3rd, 2009 at 11:58 pm |
I got better routines in copying text from one to another. I can share it here with you. I can do a lot of Autolisp programming too, but it will cost you some bucks.
To the Author:
Keep up the good work for contributing your experience to the Filipino Community. I’ve been mastering Autocadd too for 13 years and counting.
June 4th, 2009 at 12:01 am |
DEBUG IT:
Program Structures are fine only that you have a special characters on the quote signs (”"). Here it is;
(defun c:tt ( / A B)
(setq A (cdr (assoc 1 (entget (car (entsel “Select TEXT to be TRANSFER: “))))))
(while (setq B (car (entsel “Select TEXT item to be REPLACE: “)))
(setq C (entget B))
(entmod (subst (cons 1 A)(assoc 1 C)C))
(if (or (= (cdr (assoc 0 C)) “POLYLINE”)(= (cdr (assoc 0 C)) “INSERT”))
(entupd B)))
(princ))
Hope you like it.
clixs
clirrie@yahoo.com
June 4th, 2009 at 12:06 am |
Oh sorry for the last post, please remove it coz when i try to copy & paste the code it says too many arguments. Your forum automatically converts the open and close apostrophe (”") to a web characters.
For the people who wants to try this out please replace the Open & Close apostrophe in notepad then try to save it, it will work fine. I also tried it to 2007 and it works perfect too.
clixs (email: clirrie@yahoo.com)
Autolisp Programmer
September 1st, 2009 at 8:02 am |
[...] of this method here in this post Free AutoLISP Routine. Share and [...]
September 1st, 2009 at 4:00 pm |
[...] More of this method here in this post Free AutoLISP Routine. [...]
September 4th, 2009 at 3:37 pm |
[...] More of this method here in this post Free AutoLISP Routine. [...]
September 6th, 2009 at 1:47 am |
hi, i just read this one today, I made a few adjustments because there is no need for polyline and insert checking. This works also for texts nested in blocks, just do a regen to update the block.
(defun c:tt (/ A B)
(if (setq A (nentsel “\nSelect TEXT to TRANSFER: “))
(progn
(setq A (cdr (assoc 1 (entget (car A)))))
(while (setq B (car (nentsel “\nSelect TEXT item to be REPLACED: “)))
(entmod
(subst
(cons 1 A)
(assoc 1 (entget B))
(entget B)
) ;_ end of subst
) ;_ end of entmod
) ;_ end of while
) ;_ end of progn
) ;_ end of if
(princ)
) ;_ end of defun
September 10th, 2009 at 1:05 pm |
@Ronald
Thank you for that ronald.
September 11th, 2009 at 9:51 am |
You’re welcome sir,
November 26th, 2009 at 2:52 am |
clix is good in lisp! i know this guy