Hi Mostapha and thanks for your help so far.
One more question about the component. If we have surrounding buildings and want to take them into account what do we do? In the example that I attach I have extend the rays towards the sun and then trimed them with the surrounding buildings. How can I delete the trimed rays in grasshopper?
Thanks in advance,