BVN Door Renumber by Room Modifications - letter suffix instead of number suffix

Hello everyone.

I am trying to modify the BVN package’s node “Door.RenumberByRoom”. The node works very well, however I want the suffix to be letters going from a-z rather than numbers. Here is my current thought process.

I open up the BVN custom node. The area that I think I need to modify is here,

I then make this intervention with custom Python code.

My code reads:

import clr
from Autodesk.DesignScript.Geometry import *
#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN[0]

input = IN[0]
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
count = 0

for item in input:
	if item == IN[count]:
		OUT = letters[count]
	count += 1

Could anyone please steer me in the right direction or give me an easier solution? My goal is to add letters from a-z rather than numbers as the door suffix. I appreciate the help!

Hi Christian,

I think you have found the correct point in the node to modify, however I would approach changing it differently.

I do not have the package currently, but I assume the Key they are getting is outputting a list of 0 through to the number of doors in the room.

If this is true, I would use the attached image as a guide.

1 Like

Thanks for taking the time to help! This was able to get me part way there. The suffix now updates to letters, however there is inconsistency with how it is appending those letters. I believe the problem stems from the code block with ranges {0…3, 0…2, 0…4}. In some of my rooms my door marks begin repeating. Is there a way that I can modify this so that it detects how many doors in a room to add the letter suffix before repeating back at “A” regardless of the amount of doors in a room? Thanks again.

Sorry Christian, take the Code Block Node in the original definition that has “a+1” in it and plug it into the ‘List.GetItemAtIndex’ Node instead of the {0…3,0…2…} etc. Node. It was just an example.

That did the trick! Thanks again! I had to make one modification though. The a+1 was starting at the “1” index so my first letter being appended was “B”. In Python I know how to solve this, but to get it to work in Dynamo I just added an extra “A” at the beginning of the list so that index 1 came out as “A”.

Not too elegant but it worked like a charm!

Take the ‘+1’ out of the ‘a+1’ Code block, then you will not need to add an extra A.

I encourage you to copy / paste the nodes to a dynamo definition and check what they are actually doing!