Hi,
My attempt.
- (defun c:foo (/ str int sel ent get lst) (and (setq str "" lst '(("0.09" 252) ("0.49" 5) ("0.99" 3)) ;; add your more desired of strings with colours here int -1 sel (ssget "_X" (list '(0 . "TEXT") (cons 1 (apply 'strcat (mapcar '(lambda (u) (setq str (strcat (car u) ","))) lst ) ) ) ) ) ) (while (setq ent (ssname sel (setq int (1+ int)))) (entmod (append (setq get (entget ent)) (list (cons 62 (cadr (assoc (cdr (assoc 1 get)) lst)))) ) ) ) ) (princ))
|