  ;  Change the colour of an entity by selecting one of the desired colour.
  ;  Copyright 1992   Rocket Software
  ;  Caution: this software may not work on older style wooden digitizers.
 (DEFUN C:COLS (/ tt zz ss num)
  (setvar "cmdecho" 0)
  (command "undo" "mark")
  (write-line "Pick objects to recolour: ")
  (setq ss (ssget))
  (if (and ss (setq tt (entsel "Select an entity of the desired shade: \n")))
      (progn
            (setq zz (cdr (assoc 62 (entget (car tt)))))
            (if (null zz) (setq zz "bylayer"))
            (if (= zz 0) (setq zz "byblock"))
            (command "change" ss "" "p" "colour" zz "")
            (setq num (sslength ss))
            (if (= num 1) (setq tt " item ") (setq tt " artifacts "))
            (setq zz (strcat
                  (if (and (/= zz "bylayer") (/= zz "byblock")) (itoa zz) "")
                  (cond ((= zz 1) " (Red)")   ((= zz 2) " (Yellow)")
                        ((= zz 3) " (Green)") ((= zz 4) " (Cyan)")
                        ((= zz 5) " (Blue)")  ((= zz 6) " (Magenta)")
                        ((= zz 7) " (White)")
                        ((= zz "byblock") "0 (Byblock)")
                        ((= zz "bylayer") "Bylayer") (T ""))))
            (write-line (strcat (itoa num) tt "changed to colour " zz ))
            (setq ss nil))
      (write-line "No entities selected"))
 (PRINC))