Hi! I’m currently using HB Set Story, starting off with 4 rooms pre-set story. The number of rooms increases to 16 after HB Set Story. @chris this doesn’t seem like expected behavior? set_story_issue.gh (20.2 KB)
import rhinoscriptsyntax as rs
try: # import the honeybee-energy extension
from honeybee.room import Room
except ImportError as e:
raise ImportError('\nFailed to import honeybee:\n\t{}'.format(e))
import itertools
from itertools import izip
new_rooms_ = []
new_rooms = [room.duplicate() for room in _rooms]
temp_list = list(izip(_story,new_rooms))
for obj in temp_list:
obj[1].story = str(obj[0])
new_rooms_.append(obj[1])
This was by design and you have the characteristics of Grasshopper Data Trees to blame for for why the component is acting the way that it is. The component was originally designed to assign the same story value to several Rooms in a list so, if you graft the input _rooms and the input _story so that the data tree branches are aligned, it gives you the desired result:
But I can understand that most Grasshopper users would expect the component to behave in the way that you posted (using longest list logic to align the two lists together). So I just made a change to the latest development version of the plugin:
Once you get the new component, the story assignment happens as you would expect: