找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 976|回复: 2

[求助]:怎样用LISP将选中对象指定到别的图层?

[复制链接]
发表于 2007-11-20 12:01:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
如题!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2007-12-7 13:08:16 | 显示全部楼层
(defun c:gc(/ ent)
(setq Aent (getstring "\ninput entity on the target layer: "))
(setq ent (ssget))
(command "change" ent "" "p" "la" Aent "" )
)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1个

财富等级: 恭喜发财

发表于 2007-12-12 11:55:38 | 显示全部楼层
自己编的图层初始化.1-9图层
后面的程序是输入1-9快捷键,如输入"1" 选择了对像则将对像转换到1层,当前层不变,如没有选择对像则将当前层转到1层,后面以此类推!
[PHP]
;========================================
;图层初始化
;========================================
(defun c:tc ()
  (if (= (tblsearch "layer" "1") nil)
       (command "-layer" "n" "1" "color" "white" "1" "ltype" "continuous" "1" ""))
  (if (= (tblsearch "layer" "2") nil)
       (command "-layer" "n" "2" "color" "cyan" "2" "ltype" "continuous" "2" ""))
(if (= (tblsearch "layer" "3") nil)
       (command "-layer" "n" "3" "color" "red" "3" "ltype" "center2" "3" ""))
(if (= (tblsearch "layer" "4") nil)
       (command "-layer" "n" "4" "color" "magenta" "4" "ltype" "hidden" "4" ""))
(if (= (tblsearch "layer" "5") nil)
       (command "-layer" "n" "5" "color" "yellow" "5" "ltype" "continuous" "5" ""))
(if (= (tblsearch "layer" "6") nil)
       (command "-layer" "n" "6" "color" "green" "6" "ltype" "continuous" "6" ""))
(if (= (tblsearch "layer" "7") nil)
       (command "-layer" "n" "7" "color" "cyan" "7" "ltype" "continuous" "7" ""))
(if (= (tblsearch "layer" "8") nil)
       (command "-layer" "n" "8" "color" "40" "8" "ltype" "continuous" "8" ""))
(if (= (tblsearch "layer" "9") nil)
       (command "-layer" "n" "9" "color" "magenta" "9" "ltype" "phantom" "9" ""))
)
[/PHP]


[PHP]
;========================================
;图层切换
;========================================
(defun c:1 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "1" "")
    (command "clayer" 1)
  )
  (princ)
)
(defun c:2 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "2" "")
    (command "clayer" 2)
  )
  (princ)
)
(defun c:3 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "3" "")
    (command "clayer" 3)
  )
  (princ)
)
(defun c:4 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "4" "")
    (command "clayer" 4)
  )
  (princ)
)
(defun c:5 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "5" "")
    (command "clayer" 5)
  )
  (princ)
)
(defun c:6 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "6" "")
    (command "clayer" 6)
  )
  (princ)
)
(defun c:7 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "7" "")
    (command "clayer" 7)
  )
  (princ)
)
(defun c:8 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "8" "")
    (command "clayer" 8)
  )
  (princ)
)
(defun c:9 ()
  (if (/= nil (setq ss (cadr (ssgetfirst))))
    (command "change" ss "" "" "p" "la" "9" "")
    (command "clayer" 9)
  )
  (princ)
)
[/PHP]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-22 16:51 , Processed in 0.238613 second(s), 35 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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