求一个图层过滤功能,求大神帮忙,谢谢
下面代码可以将选择的图元移至指定图层(图层信息存在的前提下),现在我希望增加一个功能,
在移至指定图层的时候过滤指定的其它图层,怎么把下面图层过滤代码加进去,求大神帮忙,谢谢
图层过滤
(setq ss (ssget(list '(-4 . "<not")(cons 8 layer)'(-4 . "not>"))));;;-------------------------------------------------------------------------------------------------------------------
;;;★改图元图层
;;;By print1985 明经社区
;;;-------------------------------------------------------------------------------------------------------------------
(vl-load-com)
;冷水
(defun c:sw()(gtc "SP_W"))
(defun c:sj()(gtc "SJ_J"))
(defun c:sjs()(gtc "SJ_JS"))
(defun c:sj1()(gtc "SJ_J1"))
(defun c:sj2()(gtc "SJ_J2"))
(defun c:sj3()(gtc "SJ_J3"))
(defun c:sj4()(gtc "SJ_J4"))
(defun c:sj5()(gtc "SJ_J5"))
(defun c:sjl()(gtc "SJSTK"))
(defun c:sjb()(gtc "SJBLK"))
(defun c:sj5()(gtc "SJ_J5"))
;;;此处省略若干行类似上面的语句!!!
(defun gtc (tcm /ss k ent obj);改图层子程序
(if (setq ss (ssget))
(progn
(setq k 0)
(repeat (sslength ss)
(setq ent (ssname ss k))
(setq obj (vlax-ename->vla-object ent))
(vla-put-layer obj tcm)
(setq k (1+ k))
)
))
(princ)
)
不要沉啊,大神帮帮忙 帮你顶让大家看到 强烈支持, (setq ss (ssget(list '(-4 . "<not")(cons 8 layer)'(-4 . "not>"))));;与下一句同样效果
(setq ss(ssget(list(cons 8(strcat"~"layer)))))
(defun gtc (tcm /ss);改图层子程序
(if(setq ss(ssget(list(cons 8(strcat"~"tcm)))))
(command"chprop"ss"""la"tcm"")
)
)
页:
[1]