借花献佛,蔡建伟的源码,贴给大家,以供学习!- ;; 命令: TCF 图层置顶的LISP程序或前置后置的
- (defun C:TCF (/ E LAYER MSG OPTION SS)
- (princ "\n根据图层改变对象绘图顺序")
- (initget "A U F B")
- (setq msg "\n排序选项 [对象上(A)/对象下(U)/最前(F)/最后(B)] <最前>: ")
- (setq option (getkword msg))
- (or option (setq option "F"))
- (while (and (setq e (car (entsel)))
- (setq layer (cdr (assoc 8 (entget e))))
- (setq ss (ssget "X" (list (cons 8 layer))))
- (not (command "_.Draworder" ss "" option))
- )
- )
- (princ "\n作者: 蔡建伟 QQ: 95818608")
- (princ)
- )
- (defun C:TCB (/ E LAYER MSG OPTION SS)
- (princ "\n根据图层改变对象绘图顺序")
- (initget "A U F B")
- (setq msg "\n排序选项 [对象上(A)/对象下(U)/最前(F)/最后(B)] <最后>: ")
- (setq option (getkword msg))
- (or option (setq option "B"))
- (while (and (setq e (car (entsel)))
- (setq layer (cdr (assoc 8 (entget e))))
- (setq ss (ssget "X" (list (cons 8 layer))))
- (not (command "_.Draworder" ss "" option))
- )
- )
- (princ "\n作者: 蔡建伟 QQ: 95818608")
- (princ)
- )
|