Filtering the list by the name of the switchgear

Hello.
I start my adventure with dynamo and I I want to do a script that will export circuits to excel.
I have a problem with filtering the list by the name of the switchgear. How can I do this?


You could use group by key, but it’s hard to say without seeing your entire graph :slight_smile:



My entire graph :slight_smile:

Okay, a few things you could do:

  1. Use Element.GetParameterValueByName instead of “Parameter.ParameterByName” and “Parameter.Value”
    image

  2. Do not use several “Data.ExportExcel” nodes, use a single node and organize your data before feeding it to the export node…

  3. Use List.GroupByKey to organize your lists/values using your name of the switchgear as keys… The node works like so:
    image

  4. If you on the other hand wish to filter out certain values and only get some of the names to pass through you can use a List.FilterByBoolMask that works like so:

  5. If you wish to simplify even further you can get all your parametervalues using a single node instead of several :slight_smile:

Keep in mind I’m using “List level” (the little @1) which is achieved by clicking the rightfacing arrow on the node) and that you’re using Dynamo 2.0 which will mean that my “{” will be “[” in your version of Dynamo :slight_smile:

2 Likes

Thank you for your help! It works :slight_smile:

You are very welcome, and welcome to the adventure that is Dynamo :slight_smile: If you encounter additional issues feel free to ask the forum just remember to add as much information as you can to your post like: what happens (errors,previews etc) and what did you expect to happen (what did you wish should happen) :slight_smile:
Cheers

Thank you very much! I hope my adventure with Dynamo will be good.
I have new problem with sorting.


The number are not in proper order.

I see, try and use either list.sortbykey or list.sort :slight_smile:

After use list.sort:


In Revit I can mot change 3TK1/1 to 3TK1/01