Filter inside a dynamo script

Hi all
i always stayed away from Dynamo as it looked very deep and dificult to me.
Last week i gave it a chance and now I really like to creat script .

on my HVAC plans, I managed to create a script to number automaticly my Ducts and Ducts fittings.
My script catch the system abbreviation and mix it with numbers.

To make my script better, I would like to start the numer at 0 for each system.

To explain myself: actually on a plan with two systems (supply air / Exhaust air), my script create me a duct number SA-01/SA-02/SA-03… but also a EA-05/EA-06
Actualy, the number follow the last one doesn’t matter on witch system it is.

I would like to have a duct number SA-01 but also a EA-01
Do you understand me?

I tryed to select the elements but this node allows me to do it nly with selection not with the system (with TAB)
a filter node could be an option but I don’t really understand them,

Does anyone could help me please?

Thanks
Baptiste

1 Like

Alternative you could use this: (or parts of it)
Good luck!

here is my script

image

This part replaces your code block 1…1000

To keep equal lists

Thanks Schasfoortyoeri,
Your code helped me to understand new nodes and now my script is running great.

just last question: I have to copy/paste the code 4 times to be able to number my 4 systems.
on each copy/past i change the “System Abbreviation” filter.

Would it be possible to have just one code for all and be able by himself to separate systems?

This will work for any amount of different systems :slight_smile:

Good luck!