Filter Level Information in list

Hi all,

i have a question concerning the filtering of lists.

Goal: Add the different Level Information of families into a indivudal code which i created with the string.Concat

There are geometry in revit in 2 Levels: 0 and 1. I need a variable Information of the Level of each Family to extract the. In the future the script should work further, if someone add new Levels till 100 for example.

How can i get the variable Information of the Levels of the column for example? i am able to get the exact Level Information but i need the variable one.

Thank you!

Hi @Balko

Clockwork package has a node called “Element.Level”. You can then filter elements by its level name.

@Kulkul : Yes, i installed this package already, at the first look ist the same i did, isnt it? i filtered this with the code block.

But how can i get the Level Information into my string.concat?

Use Level.Name node.

Thanks @Kulkul: i checked this, but now this will add all 100 Levels (ok only 2 if i filter the unique ones) into my string. is there a way to get a varibale into my string?

the other question is, that i want to add a running number to my key. i checked the Enumeration of th dynablaster package, but the same Problem is here. How should i deal with this Problems? i want to add the running number as well into my key (0001, 0002, 0003 etc.).


Use “String.PadLeft” node to add 00.

@Kulkul , thanks it works for the list. Do complete my solution i have to solve two more things. I Need to add the generated Level Information and the generated counting number to my string.concat to push this individual key to each instance in my model. how can i do this?

i attached my script and a screenshot.

thank you!

@Daniel_Woodcock1 : do you have also some ideas to finish my script? :slight_smile: Parameter_10.dyn (45.0 KB)

Hi @Balko,

Just use a code block and inside it write a + “-” + b + “-” + c this will concatenate strings together with a “-” as a separator.


@Daniel_Woodcock1 , yeah, we are close to finish now :slight_smile:

how can i flatten the Level list , i just want the number of the Level withour “Level”. the second strange Thing is, that my Dynamo crushes down, if i will do another copy in the *.dyn to add my key for another categorie, such as “walls” with the same code…

Ok, i think Dynamo crushes, because at the momment i try to put different values into the same Parameter. Maybe i have to select the geoemtry in the first step global, that means alect all geoemtry in active view maybe and filter the different categories after that?

Hi @Balko,

You can flatten a list by either using the List.Flatten node or the the other List.Flatten node which flattens by a certain amount. This is a well covered topic in the forum, so do search first as the we have deviated slightly from the original question. :slightly_smiling_face:

However, make sure the list of Elements and the list of parameter values is in the same list structure or you will get undesirable results.


I searched the net for some more neebie informations for the list.faltten node. i tried to do this, but i am not able to filter just the Level Information out of it. I tried to solit this list, but there is a blank in the middle and it didnt work as well.

sorry for buffering you with this neewbie stuff.

Hi @Balko

I suggest you study all functions

1 Like

[[quote=“Daniel_Woodcock1, post:11, topic:8911”]
However, make sure the list of Elements and the list of parameter values is in the same list structure or you will get undesirable results

I tried to take care about your advice concerning the lists. But i cant see the Problem actually in this script. Dynamo crushes down if i fill out the parameerName in the “Element.SetParameterByName” Nodein the wall Group. I collect to Groups of elements, walls and columns, so it should be no Problem to fill out the same Parameter “Kennzeichen” in the ID Goup Parameter Group.

i also tried to collect the´geometry with a python script to filter the different categories out of it, but it crushed also.

I attached the script for Information.

Test.dyn (49.8 KB)