Help to change Layer's Co
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. You have to specify the layer name...
(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" ""))
Yes. Try this:
vla-put-color
Or this:
vlax-put-property 'color
This requires additional steps.
Alan, thanks for reply.
I've tried this and also not work if I already have layers with the same names.
I use CAD2002.
Slight revision to accomplish this with existing layers as well, perhaps?
Note- the asterisk will effect all layer with this prefix. Well, all you are doing is thawing and setting the color.
Are you trying to use this to create the layer?
I want to change the color properties of existing layers.
And what you have will. Perhaps you need to account for language.
(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" "")) Else look at entmod'ing the tblobjname... baby steps :wink:
页:
[1]
2