Autodesk

architecture, sustainability, building performance, environmental design, architectural science...


Solar exposure scripting

Hi,

I have been trying to construct a table of solar incidence radiation for different shading device. I naturally turned to scripting to construct this table.

The script reads as follows:

Find window
Loop over shading devices
- Create shading device
- Extract incidence radiation over the window
- Display result
EndLoop
Display result table

My problem is that the incidence radiation does not change when the shading device is changed. In short the part of the script that extract the incidence radiation is as follows:

cmd("calc.solar.total", 2)
for month = 0, 12 do
solarData[month] = 0
for hr = 0, 23 do
solarData[month] = solarData[month] + get("results.array", month, hr)
end
end

It looks that I needed to update the shading mask. So I added the following before doing "calc.solar.total":

cmd("masks.clear")
maskIndex = add("mask", objIndex)
if maskIndex == -1 then
getUserInput("Did not manage to create mask")
end
-- set("object.mask", objIndex, maskIndex)
if maskIndex ~= get("object.mask", objIndex) then
getUserInput("Did not update mask for window")
end
cmd("masks.update", maskIndex)

But I haven't had any success so far.

Does anyone has any idea what I am doing wrong?

Regards
Julien

To many commands at solar calculation
scripting radiance

Check the RADcomponents

comment posted by Oliver H :: 19 August 2008 - 8:16am

Hi Julien,
Check the RADcomponents script in the thread here. You'll probably find what your looking for.

Thanks

comment posted by juliendecharentenay :: 21 August 2008 - 11:59pm

Hi Oliver,

Thanks for your reply.

I actually found the big mistake in my script: the shading object was incorrectly created. The shading object was created as a collapsed object and then extended over the window to assess the effect of the extendt of the shading. If it is not created as a collapsed object, its shading effect is accounted for.

I also checked the thread. In the thread, the command mentionned to update the mask is as follows:

-- Create shading mask --

add("mask", selected_objects)

-- Calculation of radiantion values on selected object for single months

cmd("calc.shading.total")

I was slightly puzzled by the parameter to the add("mask" command. I believed it was supposed to be the index of the object, i.e. obj in the script. In my script, I actually use set("object.mask" to allocate the mask.

Regards
Julien



Related websites

Translate This Site

User login