Add Suffix to Duplicate Door Numbers

I am creating a script to number the doors based on the room number they are opening into. I’m trying to figure out a way to handle when more than one door opens into a room. I would like to name them with a suffix added on, so A, B, C, etc. Some stuff I’ve seen online do a fairly complicated way of grabbing the room center and rotating around clockwise. I’m looking to make it a little simpler, since I’m new to this. Is there a way to get all duplicated numbers, then add a suffix to those? So get all duplicates in my door number list, and for each set of duplicates, say A07, add a suffix. If there are three A07 doors, add an A, B, C to the ends, so they are A07A, A07B, A07C? I know it might appear to be a random sequence, but it’s better than having duplicates.

You can do something like this:

4 Likes

3 posts were split to a new topic: Add Suffix with boolean to determine the index

Is there a way to create this list to keep adding alphabets? (…X,Y,Z,AA,AB,AC)?
I’m using this to suffix room numbers, but I have more than 26 rooms sharing a number and it makes my suffixed list shorter than my element list. Its a rare use-case I know, but it will help bullet proof my script.

Sure, this should accomplish that (though you might need to add some count or something like that :slight_smile:

1 Like

Wow, that was amazingly simple. I feel kind of stupid for not searching my nodes for something like that. THANKS!

Hi Jostein,
I know I’m very late to this topic, but could you post a picture of the full code?
I’ve been trying to get this to work for a while and can’t seem to get my head around it.

I’m very new to dynamo, so it would be of great help.

Cheers