Hey @AbrahamYezioro ,
Nice! You were almost there with the shading parameters. The only thing that I had to change is that you were editing the Room2Ds that were input into the component instead of the Room2Ds that are output from the component. It all really comes down to understanding what’s happening in these few lines of the code that I originally wrote:
# assign the window parameters to the output room
new_room = room.duplicate() # duplicate to avoid editing component input
new_room.window_parameters = win_par
room2ds.append(new_room)
That duplicate() method is something that virtually all Honeybee and Dragonfly objects have and it’s pretty important if you want to build your own Grasshopper components. Essentially, it just makes a copy of the original object such that you can edit this copy (eg. assign some new window parameters or shading parameters) and the original object will not be changed. This helps preserve the fundamental logic of the Honeybee Grasshopper plugin where you input a given object to a component and get a new, edited object output from the component. Importantly, you still have the old object in it’s un-edited state if you look at the output of the previous component. What you were doing in your script, though, was editing this input object and, therefore, it breaks this Grasshopper logic.
In legacy, I think we named this process of duplicating the object “Calling from Honeybee Hive” and it was way more complicated than it needed to be. If you just remember to call this duplicate() method in [+], you should be all set to make your own Grasshopper components.
Also, here is your corrected file:
TestScriptForAbraham_AY03_CWM03.gh (50.7 KB)