;; | ---------------------------------------------------------------------------- ;; | MI_GetColor ;; | ---------------------------------------------------------------------------- ;; | Function : Returns the color information from passed parameter ;; | Argument : 'Val' - Parameter passed - Overloaded, can be either a string ;; | variable or an integer ;; | ;; | Returns : 'Variable Type' - can be either "Integer", "Real", "Character" ;; | or "List" ;; | Updated : April 8, 2002 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun MI_GetColor( Val ) (cond ((= (type Val) 'STR) (setq Val (strcase Val)) (cond ((= Val "RED") (setq Val 1) ) ((= Val "YELLOW") (setq Val 2) ) ((= Val "GREEN") (setq Val 3) ) ((= Val "CYAN") (setq Val 4) ) ((= Val "BLUE") (setq Val 5) ) ((= Val "MAGENTA") (setq Val 6) ) ((= Val "WHITE") (setq Val 7) ) ((= Val "BYLAYER") (setq Val 256) ) (T (setq Val (abs (atoi Val))) ) ) ) ((= (type Val) 'INT) (cond ((= Val 1) (setq Val "Red") ) ((= Val 2) (setq Val "Yellow") ) ((= Val 3) (setq Val "Green") ) ((= Val 4) (setq Val "Cyan") ) ((= Val 5) (setq Val "Blue") ) ((= Val 6) (setq Val "Magenta") ) ((= Val 7) (setq Val "White") ) ((= Val 256) (setq Val "ByLayer") ) (T (setq Val (itoa Val)) ) ) ) ) Val )