乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 92|回复: 16

[编程交流] Help to change Layer's Co

[复制链接]

15

主题

68

帖子

53

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
76
发表于 2022-7-6 10:26:29 | 显示全部楼层 |阅读模式
I have a doubt and I ask for help from the masters.
There is another way to change the color of a layer via LISP?
I tried this method:
 
(defun make_layer ()
(command "_.layer" "t" "LAYER_01" "c" "50" "" "")
(command "_.layer" "t" "LAYER_02" "c" "191" "" "")
(command "_.layer" "t" "LAYER_03" "c" "70" "" "")
)
 
...but does not change the color of existing layers with same name.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 10:31:49 | 显示全部楼层
You have to specify the layer name...
 
  1. (defun make_layer () (command "_.layer" "t" "LAYER_01" "c" "50" "LAYER_01" "") (command "_.layer" "t" "LAYER_02" "c" "191" "LAYER_02" "") (command "_.layer" "t" "LAYER_03" "c" "70" "LAYER_03" ""))
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:36:01 | 显示全部楼层
 
 
Yes. Try this:
 
  1. [color=#000]vla-put-color [i] [/i][/color]
 
 
Or this:
 
  1. [color=#000]vlax-put-property [i][/i] 'color[/color]
 
 
 
 
This requires additional steps.
回复

使用道具 举报

15

主题

68

帖子

53

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
76
发表于 2022-7-6 10:40:14 | 显示全部楼层
 
 
Alan, thanks for reply.
I've tried this and also not work if I already have layers with the same names.
I use CAD2002.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:42:27 | 显示全部楼层
 
 
Slight revision to accomplish this with existing layers as well, perhaps?
 
Note- the asterisk will effect all layer with this prefix.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 10:47:16 | 显示全部楼层
Well, all you are doing is thawing and setting the color.
Are you trying to use this to create the layer?
回复

使用道具 举报

15

主题

68

帖子

53

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
76
发表于 2022-7-6 10:49:06 | 显示全部楼层
 
I want to change the color properties of existing layers.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 10:55:16 | 显示全部楼层
 
And what you have will. Perhaps you need to account for language.
  1. (defun make_layer () (command "_.layer" "_t" "LAYER_01" "_c" "50" "LAYER_01" "") (command "_.layer" "_t" "LAYER_02" "_c" "191" "LAYER_02" "") (command "_.layer" "_t" "LAYER_03" "_c" "70" "LAYER_03" ""))
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:59:07 | 显示全部楼层
Else look at entmod'ing the tblobjname...
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 11:02:18 | 显示全部楼层
baby steps :wink:
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 21:21 , Processed in 2.001243 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表