AQucsaiJr Posted July 9, 2009 Posted July 9, 2009 I can't seem to figure out how to edit this LISP to make it so I can type in the defun once and click multiple lines of text before ending the command. Right now you type in the defun "TTA" and you can change one string of text then you have to type it in again. Can somone edit this so that I only have to type in "TTA" once and click multiple lines of text and then exit the command? ; copyright 2004 Rick Keller ; Date 9/30/2004 (defun c:tta (/ en sset ostr str osty sty olay lay ospt spt ojpt jpt otxht txht otxwd txwd orot rot oaln1 aln1 olan2 aln2 angd stytbl cursty curht curwd curobl curupdn curlastht curfont just newattrib entjunk junkpoint origcol col ocol) (command "undo" "begin") (SETVAR "CMDECHO" 0) (graphscr) (prompt "\nSelect text object to change.") (setq sset (entsel)) (if (null sset) (progn (princ "\nNo objects selected.") (exit) ) ) (setq en (entget (car sset)) ostr (assoc 1 en) str (cdr ostr) osty (assoc 7 en) sty (cdr osty) olay (assoc 8 en) lay (cdr olay) ospt (assoc 10 en) spt (cdr ospt) ojpt (assoc 11 en) jpt (cdr ojpt) otxht (assoc 40 en) txht (cdr otxht) otxwd (assoc 41 en) txwd (cdr otxwd) orot (assoc 50 en) rot (cdr orot) ocol (assoc 62 en) col (cdr ocol) oaln1 (assoc 72 en) aln1 (cdr oaln1) oaln2 (assoc 73 en) aln2 (cdr oaln2) angd (/ (* rot 180) pi) ) (setq stytbl (tblsearch "style" sty) cursty (cdr (assoc 2 stytbl)) curht (cdr (assoc 40 stytbl)) curwd (cdr (assoc 41 stytbl)) curobl (cdr (assoc 50 stytbl)) curupdn (cdr (assoc 71 stytbl)) curlastht (cdr (assoc 42 stytbl)) curfont (cdr (assoc 3 stytbl)) ) (command "-style" sty curfont 0 txwd 0 "n" "n" (if (> (getvar "cmdactive") 0)(command "n"))) (command "erase" sset "") (cond ((= aln1 5)(setq horiz-just "fit")) ((= aln1 3)(setq horiz-just "aligned")) ((= aln1 4)(setq horiz-just "M")) ((= aln1 2)(setq horiz-just "R")) ((= aln1 1)(setq horiz-just "C")) ((= aln1 0)(setq horiz-just "L")) ) (cond ((= aln2 0)(setq vert-just "")) ((= aln2 1)(setq vert-just "B")) ((= aln2 2)(setq vert-just "M")) ((= aln2 3)(setq vert-just "T")) ) (setq just (strcat vert-just horiz-just)) (cond ((= just "aligned")(command "-attdef" "" str str str "S" sty "j" "aligned" spt jpt)) ((= just "fit")(command "-attdef" "" str str str "S" sty "j" "fit" spt jpt txht)) ((= just "L")(command "-attdef" "" str str str "S" sty spt txht (angtos rot))) ((or (/= just "aligned")(/= just "fit")(/= just "L"))(command "-attdef" "" str str str "S" sty "j" just spt txht (angtos rot))) ) (setq newattrib (entlast)) (setq entjunk (entget newattrib)) (setq junkpoint (cdr (assoc 10 entjunk))) (command "move" newattrib "" junkpoint spt) (cond ((= col nil)(setq origcol "bylayer")) ((= col 0) (setq origcol "byblock")) ((or (/= col nil)(/= col 0))(setq origcol col)) ) (command "change" newattrib "" "p" "c" origcol "layer" lay "") (command "-style" sty curfont curht curwd curobl "n" "n" (if (> (getvar "cmdactive") 0)(command "n"))) (command "undo" "end") ) Quote
Lee Mac Posted July 9, 2009 Posted July 9, 2009 See here: http://www.cadtutor.net/forum/showpost.php?p=222163&postcount=10 Quote
AQucsaiJr Posted July 9, 2009 Author Posted July 9, 2009 Cool... I will give this one a try... Thanks Lee Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.