@Anonymous_ wrote:
....
The problem with this is it changes all the layers to 0. Is there a way to do without changing layer names
If I am correct [interpreting a combination of parts of Posts 1 & 3] that you want to change the color [only, and not the Layer] of all parts of a Block, including all parts of any nested Blocks, I think you should be able to do it by:
1) removing [or commenting out with a semicolon at the beginning] this line, which puts them on Layer 0:
(vla-put-layer obj "0"); to Layer 0
2) changing this line:
(vla-put-color obj 256); color ByLayer
to use the color you want instead:
(vla-put-color obj YourDesiredColor)
If you want them to be ByBlock color as suggested earlier, use 0 in place of YourDesiredColor.
Be aware that for nested Blocks, since it changes the color of pieces in the Block definition, it will change the color of every insertion of them, even any that are inserted on their own and not nested in other Blocks. So if you ever want the color to vary, use ByBlock instead of an explicit color.
Kent Cooper, AIA