Hi All,
I've looked around several places for a LISP that will alphabetize existing text.
I cant seem to find what I need. I am looking for a routine where I can manually select text in a given order to get the outcome of AA,AB,AC,AD, or BA,BB,BC., etc.
I've attached a drawing to better explain what I am looking for.
I do not know how to write LISP routines, but I know alittle to be able to modify an existing one.
If anyone know of anything like this, I'd love to see it.
Thanks in advance!
knj777
Solved! Go to Solution.
@Anonymous wrote:
.... I am looking for a routine where I can manually select text in a given order to get the outcome of AA,AB,AC,AD, or BA,BB,BC., etc.
....
There are things out there, but finding the right one may be a challenge. Some generate new Text that increments in one way or another, and some let you pick existing Text and modifies it incrementally. Some are limited to numerical Text, and some will do Alphabetic. Some do work with pairs of letters similar to yours. I haven't tried it out, but maybe this can do what you need, or you can adjust it. Or, this looks promising.
@Anonymous wrote:I do not know how to write LISP routines, but I know alittle to be able to modify an existing one.
If anyone know of anything like this, I'd love to see it.
Try this one. Is an old routine modified for your particular case.
It still need some error trap (for entering more than one letter as prefix or suffix etc)
(defun c:ttt ( / e prefix start) (setvar 'errno 0) (if (and (setq prefix (getstring "\nPrefix: ")) (<= 65 (ascii prefix) 90) (setq start (getstring "\Start char: ")) (<= 65 (ascii start) 90) ) (while (or (setq e (car (entsel))) (= (getvar 'errno) 7) ) (if e (if (eq (cdr (assoc 0 (setq e (entget e)))) "TEXT") (progn (entmod (append e (list (cons 1 (strcat "%%U" prefix start))))) (setq start (chr (1+ (ascii start)))) ) (princ "\nNot text. Try again.") ) (progn (princ "\nNothing selected. Try again.") (setvar 'errno 0) ) ) ) ) (princ) )