;;;Reformat and reposition/reinsert multiline text notes (not MTEXT). ;;;Also, copies text and attributes from Xrefs to fromat new notes. ;;; ;;; ;;; ;;; ;;;When Text size is specified, it is in Leroy template sizes. Leroy template ;;;sizes are in 1000ths. Leroy 100 template is 100/1000ths or 0.10" high at a ;;;dimscale of 1. It is 3.00" high at a dimscale of 30. ;;; ;;;The following are required: ;;;GETSTYLE.LSP, MKLAYR.LSP, UUTILS.LSP, TXTSIZE.LSP ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: ;;;> EDITED: 05-11-2001 ;;; (defun c:renote (/ cntr nostr) (if c:mklayr nil (load "mklayr" "\nMKLAYR.LSP not found") ) ;_ end of if (if upoint nil (load "uutils" "\nUUTILS.LSP not found") ) ;_ end of if (if dimscl nil (load "dimscl" "\nDIMSCL.LSP not found") ) ;_ end of if (dimscl) (c:svlayr) (setq cntr 0) (if getstyle (getstyle "A") (progn (load "getstyle") (getstyle "A")) ) ;_ end of if (setq how_to_do (ukword 1 "Under Reposition" "nder first string or eposition?" (if how_to_do how_to_do nil ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (setq txtsel_msg "\nSelect ATTRIB or TEXT: ") (setq txtent_lst nil) (while (setq txtselpt (getpoint txtsel_msg)) (if (setq return_selp (nentselp "" txtselpt)) (progn (setq txtsel (entget (car (nentselp "" txtselpt)))) (if (or (eq (cdr (assoc 0 txtsel)) "TEXT") (eq (cdr (assoc 0 txtsel)) "ATTRIB") ) ;_ end of or (progn (if txtent_lst (setq txtent_lst (append txtent_lst (list txtsel))) (setq txtent_lst (list txtsel)) ) ;_ end of if (setq txtent (ssadd (cdr (assoc -1 txtsel)) txtent)) ) ;_ end of progn (setq txtsel_msg "\nNo ATTRIB or TEXT selected! Try again: ") ) ;_ end of if (setq txtsel_msg "\nNext ATTRIB or TEXT: ") ) ;_ end of progn (setq txtsel_msg "\nNothing selected, try again: ") ) ;_ end of if ) ;_ end of while (while txtent_lst (setq newtxtss (ssadd)) (setq nostr (length txtent_lst)) (setq cntr nostr) (if (eq how_to_do "Under") nil (if txtsize (txtsize nil)(progn (load "txtsize")(txtsize nil))) ) ;_ end of if (if (eq how_to_do "Under") (setq thts (rtos (/ (cdr (assoc 40 (nth 0 txtent_lst))) 0.001 dimsc) 2 4 ) ;_ end of rtos ) ;_ end of setq ) ;_ end of if (setq tnjst (ukword 1 "Left Center Middle Right TL TC TR ML MC MR BL BC BR" "Left/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR" (if tnjst tnjst "L" ) ;_ end of if ) ;_ end of ukword ) ;setq (cond ((eq tnjst "Center") (setq tnjst "C")) ((eq tnjst "Middle") (setq tnjst "M")) ) ;cond (if (eq how_to_do "Under") (progn (setq txrot (angtos (cdr (assoc 50 (entget (cdr (assoc -1 (nth icntr txtent_lst)))))) 0 4)) (if (eq tnjst "Left") (setq txtpt (cdr (assoc 10 (nth 0 txtent_lst)))) (setq txtpt (cdr (assoc 11 (nth 0 txtent_lst)))) ) ;_ end of if ) (progn (setq txtpt (upoint 1 "" "Point for first line of text " nil nil)) (setq noteang (uangle 1 "View Text" "Enter text angle, match ext, or horizontal to iew" "View" txtpt)) (cond ((eq noteang "View") (setq txrot (angtos (- 0 (getvar"viewtwist")) 0 4))) ((eq noteang "Text") (setq txrot (angtos (cdr (assoc 50 (entget ent))) 0 4))) (T (setq txrot (angtos noteang 0 4))) ) ) ) ;_ end of if (setvar "clayer" (cdr (assoc 8 (nth 0 txtent_lst)))) (setq txtobl (assoc 51 (nth 0 txtent_lst))) (while (> cntr 0) (setq scntr (itoa (- nostr cntr)) icntr (- nostr cntr) ent (cdr (assoc -1 (nth icntr txtent_lst))) txstr (cdr (assoc 1 (entget ent))) ) ;setq (while (eq (substr txstr 1 1) " ") ;this while loop strips off (setq txstr (substr txstr 2)) ;leading spaces, true text ) ;while ;justification requires it (while (eq (substr txstr (strlen txstr) 1) " ") ;this while loop strips off (setq txstr (substr txstr 1 (1- (strlen txstr)))) ;trailing spaces, true text ) ;while ;justification requires it (if (eq cntr nostr) (if (eq (substr tnjst 1 1) "L") (command ".text" txtpt txtht txrot txstr) (command ".text" tnjst txtpt txtht txrot txstr) ) ;if (command ".text" "" txstr) ) ;if (setq newtxtss (ssadd (entlast) newtxtss)) (setq cntr (1- cntr)) ) ;while (command ".erase" txtent "") (if (eq how_to_do "Under") (progn (setq newsscnt 0) (while (< newsscnt (sslength newtxtss)) (setq thisent (subst txtobl (assoc 51 (entget (ssname newtxtss newsscnt))) (entget (ssname newtxtss newsscnt)) ) ;_ end of subst ) ;_ end of setq (entmod thisent) (setq newsscnt (1+ newsscnt)) ) ;_ end of while ) ;_ end of progn ) ;_ end of if (setq cntr 0) (setq txtsel_msg "\nSelect ATTRIB or TEXT: ") (setq txtent_lst nil) (while (setq txtselpt (getpoint txtsel_msg)) (if (setq return_selp (nentselp "" txtselpt)) (progn (setq txtsel (entget (car (nentselp "" txtselpt)))) (if (or (eq (cdr (assoc 0 txtsel)) "TEXT") (eq (cdr (assoc 0 txtsel)) "ATTRIB") ) ;_ end of or (progn (if txtent_lst (setq txtent_lst (append txtent_lst (list txtsel))) (setq txtent_lst (list txtsel)) ) ;_ end of if (setq txtent (ssadd (cdr (assoc -1 txtsel)) txtent)) ) ;_ end of progn (setq txtsel_msg "\nNo ATTRIB or TEXT selected! Try again: " ) ;_ end of setq ) ;_ end of if (setq txtsel_msg "\nNext ATTRIB or TEXT: ") ) ;_ end of progn (setq txtsel_msg "\nNothing selected, try again: ") ) ;_ end of if ) ;_ end of while ) ;_ end of while (getstyle "") (c:rslayr) ) ;defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 0 0 0 T T nil T) ***Don't add text below the comment!***|;