I’m working on a complex generative design tool in Grasshopper with Rhino 6. In one part, I create a list of rooms on each floor of a building, and separately, a DataTree containing the number index of each room that each of those rooms connects to. The problem is that “rooms” that are open-to-below spaces do not connect to any other rooms, so their length is 0. Normally this doesn’t cause any problems, but when the final room on the top floor of the building happens to be an open-to-below space, the final list in the connections datatree has 0 length, so grasshopper automatically removes it, which causes a list indexing error in my custom c# component, as the room list and connection datatree now have different lengths.
Is there any way to prevent grasshopper from automatically removing this 0-length list from the datatree? Simply putting a 0 there wouldn’t work, as I use 0 as the index for the first room on the first floor, and forcing the algorithm to put an unused number there, like -1 or 1000, would be a lot of work, since I would then have to code in exceptions for that value in every case that this list is checked (which is many many times). Is this my only real option, or is there a simpler way to allow grasshopper to have a 0-length list as the final list in a datatree?