dj0737 发表于 2013-8-18 00:13:15

指定图层,将该图层对象的颜色改为随层

指定图层,将该图层对象的颜色改为随层,哪位高手能用lsp做到?????

llsheng_73 发表于 2014-1-9 15:01:46

xiaobaixiaobu 发表于 2013-8-26 13:23 static/image/common/back.gif
(defun c:cb (/ ss i elist)
(setq i -1)
(repeat (sslength (setq ss (ssget)))


(defun c:cb (/ ss i elist)
(setq i -1)
(repeat (sslength (setq ss (ssget)))
    (entmod(setq i(1+ i)
               elist(entget(ssname ss i))
               elist(subst'(62 . 256)(if(assoc 62 elist)(assoc 62 elist)(assoc 420 elist))elist))))
(princ))

yangchao2005090 发表于 2019-8-15 08:35:15

香田里浪人 发表于 2014-10-6 13:18
;;;颜色随层
(DEFUN C:CBY ()
(setq s (ssget))


(defun c:GPSC ()
(or *qd (setq *qd 256))
(setq *qd (cond((getint (strcat "\n输入颜色号 <"(itoa *qd) ">: ")))(*qd)))
(vlax-for obj (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
    (if (member (Vlax-Get obj 'Layer ) (list "SwBzPWJgBz" "SwBzYYJgBz" "SwBzPWXJgBz" "SwBzYYXJgBz" "SwBzJJJgBz"))
      (Vlax-Put-Property obj 'Color *qd)
    )
)
)请问一下大神,这个代码为什么不能实现啊,附cad

vladimirputin 发表于 2016-10-19 15:16:47

都是好资料,受教了!

dj0737 发表于 2013-8-18 04:11:01

指定图层,将该图层的对象改为随层,颜色为黑色,字体为黑体,哪位高手能用lsp做到?????

xiaobaixiaobu 发表于 2013-8-26 13:23:36

(defun c:cb (/ ss i elist)
(setq i -1)
(repeat (sslength (setq ss (ssget)))
    (entmod (subst
       '(62 . 256)
       (assoc 62 (setq elist (entget (ssname ss (setq i (1+ i))))))
       elist
   )
    )
)
(princ)
)

清风明月名字 发表于 2013-8-26 20:29:26

谢谢楼主分享,辛苦了!

xiaobaixiaobu 发表于 2014-1-9 16:22:33

llsheng_73 发表于 2014-1-9 15:01 static/image/common/back.gif
(defun c:cb (/ ss i elist)
(setq i -1)
(repeat (sslength (setq ss (ssget)))


受教了!

yoyoho 发表于 2014-2-6 15:55:36

感谢 llsheng_73 分享程序!

香田里浪人 发表于 2014-10-6 13:18:09

;;;颜色随层
(DEFUN C:CBY ()
(setq s (ssget))
(setvar "cmdecho" 0)
(COMMAND "CHANGE" "P" "" "P" "COLOR" "ByLayer" "")
(PRIN1)
)

lengyan 发表于 2015-1-17 22:30:44

香田里浪人 发表于 2014-10-6 13:18 static/image/common/back.gif
;;;颜色随层
(DEFUN C:CBY ()
(setq s (ssget))


太给力了

chenbh2 发表于 2015-2-27 10:01:23

香田里浪人 发表于 2014-10-6 13:18 static/image/common/back.gif
;;;颜色随层
(DEFUN C:CBY ()
(setq s (ssget))


谢谢!受教育!
页: [1] 2
查看完整版本: 指定图层,将该图层对象的颜色改为随层