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.
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.
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.
My aim is to pull the colors of all 13 items in that list if possible. Cheers!
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.
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:
Thank you for your reply! The layerbyname was what i needed cheers!
Thank you! Your solution helped