Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, i have a program that copies the value from a text to another and i'd like the modified text to change color to red
(defun c:cpytxtval (/ oldcmd ss0 ss1 i ent0 ent1 elist1 sorText) ;; copy text value (setvar "cmdecho" 0) (command "._undo" "_begin") (setq oldcmd (getvar "PICKBOX")) (SETVAR "PICKBOX" 15) (princ "\nSelect source text.") (if (setq ss0 (ssget '((0 . "text,mtext")))) ; select single text entity ;(ssget ":S" '((0 . "text,mtext")))) ; select single text entity ;MODIFICADO 15 octubre 2018 (progn (redraw (setq ent0 (ssname ss0 0)) 3) ; highlight source text (setq sorText (cdr (assoc 1 (entget ent0)))) (princ "\nSelect target text(s)") (if (setq ss1 (ssget '((0 . "text,mtext")))) ; let user select only text entities (progn (setq i -1) (while (setq ent1 (ssname ss1 (setq i (1+ i)))) (setq elist1 (entget ent1)) (setq elist1 (subst (cons '1 (strcase sorText)) (assoc '1 elist1) elist1)) (setq COL 71) (setq elist1(subst (cons 1 COL)(assoc 62 elist1) elist1)) (entmod elist1) ); while ); progn ); if ); progn ); if (redraw ent0 4); de highlight source text (SETVAR "PICKBOX" oldcmd ) (command "._undo" "_end") ;(command "CAMBPROP" SS1 "" "CO" "71" "") (setvar "cmdecho" 1) ); c:cpytxtval
Solved! Go to Solution.