明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1335|回复: 2

[提问] 所选图层置顶的代码

[复制链接]
发表于 2014-6-22 13:09:21 | 显示全部楼层 |阅读模式
所选图层置顶的代码什么写的??
发表于 2014-6-22 13:49:08 | 显示全部楼层
_ai_molc           
发表于 2022-4-24 19:07:18 | 显示全部楼层
借花献佛,蔡建伟的源码,贴给大家,以供学习!
  1. ;; 命令: TCF   图层置顶的LISP程序或前置后置的     
  2. (defun C:TCF (/ E LAYER MSG OPTION SS)
  3.   (princ "\n根据图层改变对象绘图顺序")
  4.   (initget "A U F B")
  5.   (setq msg "\n排序选项 [对象上(A)/对象下(U)/最前(F)/最后(B)] <最前>: ")
  6.   (setq option (getkword msg))
  7.   (or option (setq option "F"))
  8.   (while (and (setq e (car (entsel)))
  9.               (setq layer (cdr (assoc 8 (entget e))))
  10.               (setq ss (ssget "X" (list (cons 8 layer))))
  11.               (not (command "_.Draworder" ss "" option))
  12.          )
  13.   )
  14.   (princ "\n作者: 蔡建伟 QQ: 95818608")
  15.   (princ)
  16. )
  17. (defun C:TCB (/ E LAYER MSG OPTION SS)
  18.   (princ "\n根据图层改变对象绘图顺序")
  19.   (initget "A U F B")
  20.   (setq msg "\n排序选项 [对象上(A)/对象下(U)/最前(F)/最后(B)] <最后>: ")
  21.   (setq option (getkword msg))
  22.   (or option (setq option "B"))
  23.   (while (and (setq e (car (entsel)))
  24.               (setq layer (cdr (assoc 8 (entget e))))
  25.               (setq ss (ssget "X" (list (cons 8 layer))))
  26.               (not (command "_.Draworder" ss "" option))
  27.          )
  28.   )
  29.   (princ "\n作者: 蔡建伟 QQ: 95818608")
  30.   (princ)
  31. )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-9-29 13:27 , Processed in 0.163162 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表