明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2724|回复: 15

如何把图元颜色设为bylayer

  [复制链接]
发表于 2005-10-31 10:08 | 显示全部楼层 |阅读模式
(setq YH_getselect (subst (cons 62 0) (assoc 62 YH_getselect) YH_getselect))设成了byblock了,bylayer怎么设
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2005-10-31 10:25 | 显示全部楼层
将组码62的点对去掉就可以了。
 楼主| 发表于 2005-10-31 10:39 | 显示全部楼层

去除了后entmod更新不了图元了

(defun c:1 ()
  (setq YH_layer "1")
  (setq YH_selection (ssget))
  (if YH_selection
    (progn
      (setq YH_repeat_times (sslength YH_selection))
      (setq YH_index 0)
      (repeat YH_repeat_times
 (setq YH_getselect (entget (ssname YH_selection YH_index)))
 (setq YH_getselect (subst (cons 8 YH_layer) (assoc 8 YH_getselect) YH_getselect))
 (setq YH_getselect (vl-remove (assoc 62 YH_getselect) YH_getselect))
 (setq YH_getselect (subst (cons 6 "bylayer") (assoc 6 YH_getselect) YH_getselect))
 (entmod YH_getselect)
 (setq YH_index (1+ YH_index))
 )
      )
    )
  (princ)
  )

发表于 2005-10-31 10:50 | 显示全部楼层

用了vl-remove后为什么要还要用SUBST?

将vl-remove后的一行删去就可以了。

 楼主| 发表于 2005-10-31 10:59 | 显示全部楼层
后面是把线型改为bylayer啊。
发表于 2005-10-31 11:00 | 显示全部楼层
没有62组码就是BYLAYER!
 楼主| 发表于 2005-10-31 11:16 | 显示全部楼层

我最后的组码是6,是线型,不是颜色。
现在问题是我把62的组码去掉后更新不了图元

发表于 2005-10-31 11:36 | 显示全部楼层
组码6也要去掉才是BYLAYER。
 楼主| 发表于 2005-10-31 11:53 | 显示全部楼层
试了,不行。
发表于 2005-10-31 12:47 | 显示全部楼层
那就只好先删除再建立图元了。
  1. (defun c:1 ()
  2. (vl-load-com)
  3. (setq YH_layer "1")
  4. (if (setq YH_selection (ssget)) (progn
  5.   (setq YH_index 0)
  6.   (repeat (sslength YH_selection)
  7.    (setq YH_getselect (entget (ssname YH_selection YH_index)))
  8.    (setq YH_getselect (subst (cons 8 YH_layer) (assoc 8 YH_getselect) YH_getselect))
  9.    (setq YH_getselect (vl-remove (assoc 62 YH_getselect) YH_getselect))
  10.    (setq YH_getselect (vl-remove (assoc 6 YH_getselect) YH_getselect))
  11.    (entdel (ssname YH_selection YH_index))
  12.    (entmake YH_getselect)
  13.    (setq YH_index (1+ YH_index))
  14.   )
  15. ))
  16. (princ)
  17. )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-4 12:02 , Processed in 0.289332 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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