Ecotect Analysis Forum (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script for solar radiation hourly

2 REPLIES 2
Reply
Message 1 of 3
hottrinity
547 Views, 2 Replies

Script for solar radiation hourly

I have been struggle to make a script for "insolation on grid hourly" on the conservatory.

I am trying to calculate Insolation for hourly on the grid (not full 3d) for the period of e.g. Jan.

It would be wonderful if anyone helps me !

Script is below.

=====

-- This script calculates the INSOLATION off the analysis
-- grid, and average INSOLATION for the same
-- for each hour, from sunrise to sunset.in summer


--Start Script
cmd("script.start")

-- Get the current model zone.
currentzone = get("model.currentzone");
grid = get("grid.title")

-- Print out a title.
printf("Model: %s", get("model.file"));
printf("Zone: %s", currentzone);
printf("Grid: %s",grid);

-- Print out table heading.
printf("\nDay\t Hour\t insolation");

--Bring up Ecotect's Canvas
cmd("app.activate")
cmd("app.minimize", false)

--View model in Plan View
cmd("view.fit")
cmd("view.plan")
cmd("view.redraw")

-- Set date.
for day = 1,31 do
set("dayoftheyear", day);
cmd("view.redraw")

-- Calculate Insolation
set("grid.data", 0);
cmd("calc.insolation.grid", 0, 1, false)


-- Cycle through hours of day.
for hour = 0, 23, 1 do
set("time", hour);
cmd("view.redraw")
Average0 = get("grid.average")


-- Get readable time format.
minutes = (hour - floor(hour)) * 60;
hours = floor(hour);
hr = hours + (minutes/100)



-- Print table
printf("%03d\t%4.2f\t%5.2f", day, hr, Average0);


end

--Pause between each day
pause(250)

end
2 REPLIES 2
Message 2 of 3
mritmeijer
in reply to: hottrinity

Hi,

 

Is this problem solved? Because I have the same problem with getting hourly values for the total radiation (from sun) on a surface. I can't get the hourly values from the calculation cmd("calc.insolation", "objects", "incidence", true, "hourly").

 

I used this command (from someone else on this forum) to cycle through the hours during the year:

for day = 1,365 do
for hour = 0,23 do

set("juliandate", day);
set("model.time", hour)

 

But the problem is that it will not show the results in a table by using the print or printf function. 

 

I hope someone can help me with a script for geting the hourly values of the radiation [W/m2] from the sun on a object (sensor point).

 

Thanks in advance.

 

Maikel

Maik
Message 3 of 3
Pennetier1
in reply to: mritmeijer

Hello Maikel, 

 

Not sure where your script went wrong, but here is another one that should work for a selected object - note that it will not work on point objects as they have no surface area and the solar exposure calculation will not work on them.

 

You can always copy and paste the results in an Excel spreadsheet; alternatively, I can also update the script to send the results into Excel directly.

Also note that when selecting "Run on remote server (F9) in the Script manager menu > Script, the results will come out within the Ecotect window and can be access via the Calculate menu > script output.

 

I hope this helps.

Let me know if you have more questions on this topic, otherwise please accept as a solution so that others can benefit from this information.

Cheers,

Olivier A. PENNETIER

SYMPHYSIS

www.symphysis.net

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report