本帖最后由 llsheng_73 于 2014-1-9 13:01 编辑
- (defun C:Layoff (/ ss cnt c lys lay layersoff)
- (defun layersoff(lys / ly);将lys表中的所有图层关闭
- (foreach x lys
- (vla-put-layeron(vlax-ename->vla-object (tblobjname "LAYER" x)):vlax-false)))
- (setq ss(ssget))
- (setq cnt(sslength ss)c 0 lys nil)
- (while(< c cnt)
- (setq lay(cdr (assoc 8(entget(ssname ss c))));;;(setq lay(vla-get-layer(vlax-ename->vla-object(ssname ss c))) lys(if(member lay lys)lys(cons lay lys))也行
- lys(if(member lay lys)lys(cons lay lys))
- c(1+ c)))
- (layersoff lys)
- )
|