Combine values in list to a new reduce list

Hi, am trying to filter a list of string layer names from all the objects in modelspace. So, my list have for example 120 repeated “0” values. My name goal is to create a clean list of all the layers with objects on modelspace. I am not sure how to combine rows with the same value. Any ideas i would appreciate, thanks.

List.UniqueItems

I tried that node but didn’t work.

Either flatten the list first or set the level on List.UniqueItems to @L2.

Flatten the list did the trick. Thank you Mzjensen

:grinning:

Hah! You beat me. I was just about to suggest flattening the list. Easy fix :slight_smile:

This would be the secondary solution. Click on the arrow on the “List.UniqueItems” node and select “Use Levels”. Set this to @L2.

Thank you for the alternative solution. i wondering if there is a cleaner way to filter the layer name of all the objects currently in modelspace. This script i am working on is to be use in the creation of a legend.

You could also try the legend nodes that are built into the Civil 3D Toolkit. Might save some time.

There is probably a way to select all objects but I am unsure of how. You could replace the “Objects Types” node with a list of the different types. To keep all of those in one node.

That works better and its cleaner. I didn’t know you can list it like that. Thanks

I saw that but i can’t find examples on using those nodes

there is no documentation because it could not be simpler


Thank you Paolo for the example. The typical legend we create are based on the items in model space but its a dummy legend. Just text, lines, hatches and some blocks. they have to constantly be updated manually so i wanted to try to create a dynamo legend that updates the legend with one click.

please post the dwg file