This is a great lisp file that matches text strings. The only this that it doesn't do is show selected text. What needs to be done to make it show this selection? ;********************************************************************** ; Original Program Name: C:CA ; Description: Match text values in attributes or text strings. Pick ; Source entity (Attribute or Text) then pick destination ; entity, it will copy the text value from the source to ; the destination. ; Date: 4-23-99 ; Version: 1.00 ; Author: Micah Nerren (714) 556-4454 ;********************************************************************** ; New Program Name: C:CopyText ; Overhauled 06-19-02 by John Uhden, Cadlantic ; based on request by [email][/email] ; in the AutoCAD Customization Newsgroup. ; Note: Since there's almost nothing left of the original code, ; this is donated as public domain, aka "Freeware" ; R15+ only ;********************************************************************** (defun C:CA ( / *error* source text pick target ent layer) (vl-load-com) (if (not *acad*)(setq *acad* (vlax-get-acad-object))) (defun *error* (errmsg) (vla-EndUndoMark (vla-get-activedocument *acad*)) (and errmsg (not (wcmatch (strcase errmsg) "*QUIT*,*CANCEL*")) (princ (strcat " ERROR: " errmsg)) ) (princ) ) (vla-StartUndoMark (vla-get-activedocument *acad*)) (AND (setq source (car (nentsel" Select Source Text/Attribute: "))) (setvar "errno" 0) (or (member (cdr (assoc 0 (setq source (entget source))))'("TEXT" "ATTRIB")) (prompt " Must be either an Attribute or Text!") ) (setq text (cdr (assoc 1 source))) (princ (strcat " Source Value = " text)) (while (/= (getvar "errno") 52) (and (setq pick (nentsel " Select target Text/Attribute to change: ")) (setq target (car pick)) (setq ent (entget target) layer (cdr (assoc 8 ent)) target (vlax-ename->vla-object target) ) (or (= (length pick) 2) (prompt " Target is nested in a Block or Xref") ) (or (member (cdr (assoc 0 ent)) '("TEXT" "ATTRIB")) (prompt " Must be either an Attribute or Text!") ) (or (/= (logand 4 (cdr (assoc 70 (tblsearch "layer" layer)))) 4) (prompt (strcat " Layer " layer " is locked")) ) (or (/= (vla-get-textstring target) text) (prompt " Text is the same.") ) (and (not (vla-put-textstring target text)) (/= (vla-get-textstring target) text) (princ " Failed to modify target.") ) ) ) ) (*error* nil) )