Change Color of Layer for Folder of DWGs

Hey All,

Are there any nodes or python scripts out there that can help change the color of a layer on a folder of DWGs? Details below

  1. I have a model file that is x-referenced to multiple sheet files.
  2. I need to go into each sheet file and change the color of a layer from black to 252 (gray). I can’t just change this layer in the model file because the layer needs to remain black in another set of sheets.
  3. Seems like a good task for some level of automation. Not sure if this has been done in dynamo? If there is a better way to do it with other existing civil 3d tools I am open to that as well.

Thanks

Hi,
Sure! you can call multiple DWG files, then use external functions of the Cambar package to call/ filter layers that you want to change thier color. Finally, use ExternalLayer.SetColor to change the color of the layers.

best

@y.srewil Thanks for your help! How would I call multiple DWGs? Do I need to do something different than what I have shown below? Also, what if I wanted to change the color of a large number of layers at once (where typing them all into a code block would take too much time)? Is there a better way to call a multitude of layers than I am doing currently? Thanks!

At the beginning of the graph, use a list of file paths instead of a single file path.

Is there a quick way to get all the DWG paths from a folder without having to type them out?

5 Likes