Ladybug Sunlight Hours Analysis - LegendPar (Update Ladybug

Hello boys and girls,

Recently I’ve updated to .61 version and needed to work on some sunlight hours analysis. In such cases I just open the example files kindly provided by Ladybug creators (thank you, love you guys), naturally they get outdated time to time and I update them with Update Ladybug component. Same here but this time I stumbled upon some errors.

After the update all the LegendPar components returned error, this happened before and could be fixed by deleting the problem component with newly updated one (if memory doesn’t play wacky tricks on me, I remember Mostapha explained that this could happen when the old component had different amount of plugs with the source code, since only the code is being updated, correct me if I’m wrong), but it didn’t work this time.

As you can see on the image below, the red one is the original component and the new one is placed above it. Although the red component is connected, SunlightHours doesn’t “see” it and show the analysis in fifty shades…ghmm, sorry, in gray shades, which is very hard to distinguish sometimes.

Error balloon says:

  1. Solution exception:name ‘decimalPlaces_’ is not defined

When I connect new LegendPar component SunLightAnalysis gives me this:

Error balloon says:

  1. Solution exception:index out of range: 9

At this time analysis diagram says bye bye and nothing works. I tried to change and reconnect all the wires and dance around the computer but nothing worked, is it possible that this is a bug? Or am I doing something cool?

Sorry for the amount of letters here, have a good day. (521 KB)


Your memory is fine … but not full. Such components that change the number of inputs/outputs must be reinserted and not just updated.

See attached for a working version of your file. Notice that the legendPar is different.

-A. (538 KB)

Hi Abraham,

But I did reinsert it, the one on top is a newly placed and it still didn’t work. That’s very weird, because I do know that reinserting fixes the problem.

Thanks for the help, I’m not currently at the office where I have my model, when I get there I’ll check the old definition again and your fix, thank you for reply, I really appreciate it because this one is really out of the blue.

Very interesting. When I opened your file I saw the newest LegendPar placed by you, indeed, it’s different, however when I replace LegendPar it appears to lack those inputs.

I think I’ve got the files from Food4Rhino last time, maybe this one wasn’t fully updated? However the case, I’m heading to the GitHub. Thanks for your time.

Ok, got the files from the GitHub, now everything works fine, except…

I think I’ve stumbled upon an old bug with OrientationStudyParameters component that hasn’t been fixed yet.

  1. Solution exception:global name ‘legenPar’ is not defined

It just doesn’t work, it is not essential for me to get it working, so it is more of a side notice, it seems that this one is either not the most popular component or hard to fix.

There is indeed a bug.

I disconnected the legendPar and then i get the following:

  1. Solution exception:index out of range: 9

I don’t know if this is or not popular but i’m sure Mostapha will check this as soon as he can. Don’t think this will be hard to fix.


Thanks, is there a way to comment on bugs on GitHub? I tried to sign up there, but then I noticed the subscription plans, so I assumed it wasn’t free. I feel that creating a discussion for each bug is a bit of an overkill.

I love the work you guys are doing, and can’t wait for butterfly, oh boy having a CFD here will be a blessing. Anyway, thank you for you time and sorry for an overkill with the bugs.


Hi Tim and Abraham,

Tim, Github is free unless you want to have private repository. You can just select the free plan. Example files on Hydra are usually synced with the version on Food4Rhino (which is the stable release) and not the github (which is the production version). Orientation analysis issue looks like a bug. The reason it hasn’t been fixed is that I want to re-write the component for sunlight-hours analysis. The current version is such a mess.

Ok, got it. Signed up there, see how it works and how I can help.

Just a fun question from a perfectionist Nazi:

Whyyyyyyyyyyyyyyyyyyyyyyyyyyy!? X’D

Good one! Maybe the first issue that you can add to Ladybug repo (

Yes Sir!