# Direct sunlight hour analysis

Hi

I’m wondering if there is a Dynamo node that can calculate the number of hours of direct sunlight a surface receives. Basically I want it to work like the ‘Sunlight hours analysis’ component found in Ladybug in Grasshopper. All I can currently see in Dynamo is daylighting and solar insolation. I would like to avoid constructing it from scratch if possible. Any thoughts?

anyone?

1st, I think just few in here know about Ladybug, cuz it’s hard to get an opinion. (I’ve got to know about it from you too.)

2nd, after briefly reviewing Ladybug(from bottom link), I suppose most of the functions in Ladybug can be achieved by Vasari & Dynamo.

Which particular feature are you looking for?

Ladybug is all open source and its written in Python (https://github.com/mostaphaRoudsari/ladybug). I’m going to try and transcode it into Dynamo unless someone has a better solution. Ladybug’s sunlight hour analysis basically calculates the number of hours a point receives during an analysis period. The workflow is as such:

• Create an analysis period. This can be somewhat replicated with the sunSettings.StartDateTime (and End nodes). Although the time shown is in UTC which is confusing. But when it reads the current view, it doesn’t pick up the range of dates/times, only the start and end.

• Calculate the sun vectors. This should be pretty easy as I can get the Altitude and Azimuth direct from Dynamo. It just needs to be tweaked so that it is a range, i.e. from 9am-4pm rather than a single still.

• An analysis surface needs to be divided, essentially turning it into a mesh. From each vertex (or UV point) a line is drawn along the sun vector. If it intersects with other geometry its in shade. If not, it receives direct sunlight. Repeat for the entire analysis period. Sum the total instances no intersections occur to get the duration of time it is in direct sunlight.

The nodes I see in dynamo seem to be for thermal/energy analysis, not solar. Any whelp would be appreciated. Thanks

But it seems mostly about how to collaborate Ladybug & Dynamo rather than replicate Ladybug in Dynamo. I think it will be the first if you make one.

In my opinion it looks pretty complicated but must be possible. And your logic totally makes sense.But at the shade analysis part, i’d rather find shade area first(start&end point or curve) than checking entire period. It doesn’t look big difference, but checking all period will take much more time to get accurate result.

I believe there is a solar analysis package on the package manager that should do what you want(seems like you’re already using this, sorry.), I believe the solar analysis nodes perform similarly to the solar analysis that is present in Vasari.

Are you getting unexpected analysis results?

Is it possible to set the analysis for a single instantaneous analysis, as opposed to cumulative etc.

The Solar Analysis for Dynamo package (0.1.2) doesn’t have direct sunlight. Also strangely, I am using the latest Dynamo daily build and if I go to installed packages it says its installed, but it doesn’t appear in the menu and my old scripts with solar analysis nodes in them doesn’t work/show.

There are very specific solar regulations here in Sydney. Apartments must achieve a min. of 2 or 3 hours of direct sunlight between 9am-3pm on the winter solstice. Ladybug did this perfectly. Set the interval for say 15 mins, so 6 hours x 4 intervals = 24 separate studies. It then stores the accumulative values and returns a coloured mesh with baked vertices.

Konrad’s post looks as though he is running the analysis in Ladybug and then exporting the values to Dynamo to recreate. I want to be able to run the analysis directly in Dynamo. Grasshopper is great for the earlier stages of a project but at some point the Revit model needs to take over which makes Dynamo a better option for analysis

I’ve uploaded some custom nodes in the package manager called ‘BVN’. In there are two nodes to help this issue: SunSettings.TimeZone and SunSettings.GetTimesAndSunDirections.

The OFTB SunSetting.StartDateTime always return the date/time in UTC. This is confusing if you are in another time zone. SunSettings.TimeZone will return the difference which you can then add to TimeSpan.Create to get the true date/time.

And despite having a single day solar day with internal setup, the SunSettings.SunDirection only show the start vector. The SunSettings.GetTimesAndSunDirections returns all vectors. This should make it easier to do sun studies over a given period. Now all I need to do is figure out if its possible to move the sun path in Revit so that it looks correct!

Hi Paul,

Did you get anywhere with getting sun calcs done with Dynamo?

I’ve started doing simillar thing, but so far I just have a collector of all windows in Living Rooms and struggling a bit with interpreting the results of the raybounce.

Hi,

I’d like to be able to tell, for how many hours a LIVING room receives direct sunlight.

I’ve managed to create a definition that gives me the list of rooms with the name LIVING that receive direct sunlight.

However, I’m having trouble to track back the results to the original sunlight vectors.

Any ideas?

DirectSunlight

Anyone?

Hi Maciej

So you’re working on SEPP65 too? I haven’t had a chance to finish off my script. I’ve been away. Will try to do it in the next week or two.

I would suggest you use the LunchBox room collector node. This will output a bunch of useful information including room boundary and centroid. Might be simpler.

Hi Paul,

I’ve only just noticed your response. I’m working on the SEPP65 and get that definition to work(…well… kind of work…)

The biggest problem I’m having is that the RayBounce is either take lots of time to process * (and crashes most of the time) - I’m working on a development of about 400 units and there is a lot overshadowing, so I have to up the number of rays quite a bit to get at least a reasonable approximation of the shadows.

I’m looking to optimize it with Python - I’ll let you know if I’ll get anywhere

Hi guys, how did it go using revit / dynamo to calculate the amount of sun hours?

Regards
Michael

I got a proof-of-concept working. But I’m yet to test it on a large model. It is for sure way slower than using Grasshopper.

What exactly are you trying to do?

Thanx for your initiate on this. Any luck getting it to work? I’ve just started working on something similar with similar requirements in NZ.

J, I recently built a sunlight hours analysis script using Dynamo, try this method;

• Use the Surface.Isoline nodes to equally divide a surface into U/V points using ‘Point at parameter’ node.
• I suggest baking ‘sensor’ families into the model for analysis in a separate script
• Using the Ladybug package, reverse a vector from each sensor/point at relevant sun hours. Use ‘element.geometry’ to convert any ‘collision’ objects to Dynamo, and check the vectors for intersection with these forms
• Collect all vectors that do not intersect, the total will be sun hours per sensor

Obviously this doesn’t do the ADG Sepp65 1m check inside the building, but suits high level analysis. I suggest using Grasshopper/Rhino for this instead, as Dynamo struggles to handle the amount of geometry this method requires.

1 Like

Thanx @GavC

I’m currently exploring the new Ladybug Dynamo Package bug I’ll definitely take your advice and compare the two.

Thank you.

1 Like

No worries, this is the nodes that will kick off the sun vectors - took me a while to figure them out my first time around the block with Ladybug! How you generate HOY is up to your study, in this one for example I needed a vector for all hours of the day between 8 and 3 so fed a range into the hours node.

You’ll need an EPW file as well, most locations are free and can be found here;
https://energyplus.net/weather

If you hit any brick walls let me know, happy to help. I’ll be uploading video tutorials on the workflow and how to build the scripts in a few weeks most likely (https://www.youtube.com/channel/UCry22yTdpgEDdzIZig7NSMQ).

Thanx so much for the share. I’m sure I’ll run into roadblocks and this will be a massive asset as a roadmap. Kudos for the video!

Thanks again.

1 Like