Sunday, August 31, 2014

测试语法

  
int main()
{
   int a ;
   int b;
   return 0;
} 
  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ColorIndex-to-TrueColor - takes an AutoCAD color index (1 through 255) and returns the equivalent 
;; TrueColor value.
;;
(defun ColorIndex-to-TrueColor ( ci / colorObj TrueColor )
 (vl-load-com)
 (and (setq colorObj (vla-getinterfaceobject (vlax-get-acad-object) "AutoCAD.AcCmColor.16"))
      (>= ci 1)
      (<= ci 255)
      (not (vl-catch-all-error-p 
            (vl-catch-all-apply 'vla-put-ColorIndex (list colorObj ci))
           )
      )
      (setq TrueColor (TrueColor-make 
                          (vla-get-red   colorObj)
                          (vla-get-green colorObj)
                          (vla-get-blue  colorObj)
                      )
      );setq
 );and
 TrueColor
);defun ColorIndex-to-TrueColor

No comments: