Hello Augi members,
Need some help with a lisp routine.
1. I have a lisp that allows user to edit all forms of text with one command "te". Problem: User must select each text item individualy. Can not window text, because when editing text it's not organized.
2. Found a lisp that allows user to window text, then it organizes text for editing left to right, top to bottom. Problem: I want to make it smart enough to handle any type of text it encounters. One Command. I have been able to make this work, by pasting all three lisps into one file, and have one command activate it. Problem is you have to hit enter, to activate they type of text editing you would like it to complete. Would like this to be able to tell the type of text editing is beeing done based off of what is selected. Any help is much appreciated. note, using ACAD 2011.

Thanks for reading,
Tim

Lisp 1: TE
(defun C:TE()
(setq ss (ssget))
(setq i 0)
(while (< i (sslength ss))
(setq en (ssname ss i))
(setq ed (entget en))
(cond
( (= (cdr (assoc 0 ed)) "TEXT")
(command "DDEDIT" en)
(command "")
)
( (= (cdr (assoc 0 ed)) "ATTDEF")
(command "DDEDIT" en)
(command "")
)
( (= (cdr (assoc 0 ed)) "INSERT")
(command "DDATTE" en)
)


)
(setq i (1+ i))
)
)
(princ "\n TE" )
(princ)



Lisp 2 Contains 3 separate lisp files (a,b,c), I would like to integrate into 1

A.
(defun c:tea (/ selset loc:get_txt_point)
(defun loc:get_txt_point (ent)
(if (/= (cdr (assoc 72 (entget ent))) 0)
(cdr (assoc 11 (entget ent)))
(cdr (assoc 10 (entget ent)))
) ;_ end of if
) ;_ end of defun
(if (setq selset (ssget "_:L" '((0 . "TEXT"))))
(foreach txt
(vl-sort
(vl-sort
(vl-remove-if 'listp (mapcar 'cadr (ssnamex selset)))
'(lambda (a b)
(< (car (loc:get_txt_point a))
(car (loc:get_txt_point b))
) ;_ end of >
) ;_ end of lambda
) ;_ end of vl-sort
'(lambda (c d)
(> (cadr (loc:get_txt_point c)) (cadr (loc:get_txt_point d)))
) ;_ end of lambda
) ;_ end of vl-sort
(command "_.ddedit" txt "")
) ;_ end of foreach
) ;_ end of if
) ;_ end of defun

B.
(defun c:teb (/ selset loc:get_txt_point)
(defun loc:get_txt_point (ent)
(if (/= (cdr (assoc 72 (entget ent))) 0)
(cdr (assoc 11 (entget ent)))
(cdr (assoc 10 (entget ent)))
) ;_ end of if
) ;_ end of defun
(if (setq selset (ssget "_:L" '((0 . "ATTDEF"))))
(foreach txt
(vl-sort
(vl-sort
(vl-remove-if 'listp (mapcar 'cadr (ssnamex selset)))
'(lambda (a b)
(< (car (loc:get_txt_point a))
(car (loc:get_txt_point b))
) ;_ end of >
) ;_ end of lambda
) ;_ end of vl-sort
'(lambda (c d)
(> (cadr (loc:get_txt_point c)) (cadr (loc:get_txt_point d)))
) ;_ end of lambda
) ;_ end of vl-sort
(command "_.ddedit" txt "")
) ;_ end of foreach
) ;_ end of if
) ;_ end of defun


C.
(defun c:tec (/ selset loc:get_txt_point)
(defun loc:get_txt_point (ent)
(if (/= (cdr (assoc 72 (entget ent))) 0)
(cdr (assoc 11 (entget ent)))
(cdr (assoc 10 (entget ent)))
) ;_ end of if
) ;_ end of defun
(if (setq selset (ssget "_:L" '((0 . "INSERT"))))
(foreach txt
(vl-sort
(vl-sort
(vl-remove-if 'listp (mapcar 'cadr (ssnamex selset)))
'(lambda (a b)
(< (car (loc:get_txt_point a))
(car (loc:get_txt_point b))
) ;_ end of >
) ;_ end of lambda
) ;_ end of vl-sort
'(lambda (c d)
(> (cadr (loc:get_txt_point c)) (cadr (loc:get_txt_point d)))
) ;_ end of lambda
) ;_ end of vl-sort
(command "_.DDATTE" txt "")
) ;_ end of foreach
) ;_ end of if
) ;_ end of defun