明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 893|回复: 4

[源码] 图元颜色的修改

[复制链接]
发表于 2018-10-21 23:32 | 显示全部楼层 |阅读模式
如果图元的颜色随层,怎么通过下面的方法进行修改颜色。
(setq ent (entget(car(entsel))))
(setq ent (subst (cons 62 2) (assoc 62 ent) ent))
(entmod ent)
发表于 2018-10-22 08:21 | 显示全部楼层
(vla-put-Color (vlax-ename->vla-object (car (entsel))) 2)
回复 支持 1 反对 0

使用道具 举报

发表于 2018-10-22 08:21 | 显示全部楼层
(entmod(append(entget(car(entsel)))'((62 . 2))))
回复 支持 1 反对 0

使用道具 举报

发表于 2018-10-22 08:12 | 显示全部楼层
本帖最后由 gaics 于 2018-10-22 08:20 编辑

(setq ent (entget(car(entsel))))
(entmod (reverse (cons (cons 62 2) (reverse ent))))
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2018-10-22 22:45 | 显示全部楼层
llsheng_73 发表于 2018-10-22 08:21
(entmod(append(entget(car(entsel)))'((62 . 2))))

用这种方法不用subst就能修改图元的图层和颜色,entmod图元后图层和颜色的数据直接替换之前的。请问下是不是可以用这种方法直接修改图元的属性。
(entmod(append ent '((8 . "0")) '((62 . 1))))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-19 16:49 , Processed in 0.216303 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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