# Extracting the layer colors from a list of polylines

**URL:** <https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952>\
**Category:** Civil 3D\
**Tags:** dynamo, civil3d\
**Created:** [April 28, 2022, 8:33am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952 "2022-04-28T08:33:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hacharoui](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hacharoui](https://forum.dynamobim.com/u/hacharoui)\
**Post date:** [April 28, 2022, 8:33am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/1 "2022-04-28T08:33:38Z")

</div>

Hello guys, I am trying to extract the layer colors of a list of polylines in AutoCAD civ 3d. The list of polylines was created using the List.UniqueItems node. I want to apply these colors extracted to a list of solids within the AutoCAD file. Apologies I am quite new to dynamo so would really appreciate some guidance on this.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/e/cecc813e4bd12fe7501c0fa63d45f002ba3aeac3.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 28, 2022, 9:14am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/2 "2022-04-28T09:14:38Z")

</div>

You have objects, not layers at this point. Check the Object section (under AutoCAD) in the library, and you can pull the object’s color. This isn’t necessarily the same as the layer’s color though, for that you would want to pull the object’s layer (same spot of the library) and then query that layer’s color with the node you’ve found.

Give it a shot and let us know if you’re still stick.

---

<div class="post-metadata">

**Author:** ![hacharoui](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hacharoui](https://forum.dynamobim.com/u/hacharoui)\
**Post date:** [April 28, 2022, 9:34am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/3 "2022-04-28T09:34:32Z")

</div>

Hello thanks for the reply!

When connecting the **object.color** node to the **list.uniqueitems node** , an error message **(Warning: Object.Color expects argument type(s) (Autodesk.AutoCAD.DynamoNodes.Object), but was called with (string[]).)** appears.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/b/abc15eeb4b4126b96678def097c42a8db986caf3.jpeg)

My aim is to pull the colors of all 13 items in that list if possible. Cheers!

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [April 28, 2022, 9:39am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/4 "2022-04-28T09:39:29Z")

</div>

Ah! I didn’t understand where you were at as the description (“The list of polylines”) doesn’t match the picture (I believe it’s a list of layer names?).

I’m about to step out for awhile and then have to get to work (two presentations today) so I may not be able to help directly for a bit. if you hit the ‘export canvas as image’ button while zoomed in like this (or even a little bit closer) you can post an image of your entire graph so the larger community can review what you have and the best way to get back to where you want to be.

In the the meantime, searching the library for stuff like “LayerByName” might be worth reviewing as the solution may be in there.

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [April 28, 2022, 9:47am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/5 "2022-04-28T09:47:52Z")

</div>

Hi @hacharoui ,

Your strings represent your layer-names, not the corresponding layers. This means that you’ll have to import the AutoCAD layers by their name first to be able to get the color of said layer:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/f/3fff955cae43bddda173431c1035dc6e7700cba0.jpeg)

---

<div class="post-metadata">

**Author:** ![hacharoui](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hacharoui](https://forum.dynamobim.com/u/hacharoui)\
**Post date:** [April 28, 2022, 11:18am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/7 "2022-04-28T11:18:46Z")

</div>

Thank you for your reply! The layerbyname was what i needed cheers!

---

<div class="post-metadata">

**Author:** ![hacharoui](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hacharoui](https://forum.dynamobim.com/u/hacharoui)\
**Post date:** [April 28, 2022, 11:19am UTC](https://forum.dynamobim.com/t/extracting-the-layer-colors-from-a-list-of-polylines/75952/8 "2022-04-28T11:19:26Z")

</div>

Thank you! Your solution helped
