基本可用,但没有考虑图块、属性块的情况,见笑:- (defun c:fzcl( / ss i len ent)
- (vl-load-com)
- (setq ss (ssget))
- (if ss
- (progn
- (setq i 0)
- (setq len (sslength ss))
- (repeat len
- (setq ent (vlax-ename->vla-object (ssname ss i)))
- (vla-put-layer ent "0") ;到0层
- (setq i (+ 1 i))
- )
- (princ "改为0层已完成。")
- (command "_copyclip" "p" "")
- (princ (strcat "已复制"(itoa len)"个对象到剪贴板。"))
- )
- (princ "没有选择对象。")
- )
- (princ)
- )
|