- (defun c:tes ( / a62 a8 ent1)
- (if (null vlax-dump-object) (vl-load-com) )
- (if (setq ent1 (entsel "\n请选择对象"))
- (progn
- (setq ent1 (vlax-ename->vla-object (car ent1)))
- (setq a8 (vla-get-layer ent1));图层
- (setq a62 (vla-get-color ent1));颜色
- (setq a62 (rtos a62 2 0))
- (setvar "CECOLOR" a62);颜色
- (setvar "Clayer" a8);图层
- )
- )
- (princ)
- );如果用VLA的话,程序应当比较短
|