CATeco – get(“results.solar.incident”, hr) — working??

Some of us had problems getting different results in the EcotectLouverDemo, we all got the same results for each day, but trying this I got different results for each one and it seems to work.(double checked manually):

---STUDY---
-- Cycle through months:
for i = 1,4 do
-- Set date.
set("day", CalcRange[i])
day = get("model.dayoftheyear")
print(day)
for hr = 8, 17   do   --or FirstHour, LastHour
cmd("select.object", 0)
cmd("selection.update")
set("time", hr)
cmd("calc.solar","day", 2, 0, 1) --THIS THE DIFFERENCE--
SolarInc = get("results.solar.incident", hr)
print(SolarInc)
sheet1.Cells(10+i,hr).Value2 = SolarInc
sheet1.Cells(10,hr).Value2 = hr
end
--Enjoy--

How to add posts with highlighted syntax

This site uses the syntax highlighter plugin from Alex Gorbatchev

Here is a list of supported syntax brushes. I also added a brush for Lua. Please let me know if you want me to add further brushes.

The advantage of using a highlighter is clear: Code that has been posted in this blog will look like this:

If a > b Then
    MsgBox "a > b"
ElseIf c > a
    MsgBox "c > a"
ElseIf b > c Then
    MsgBox "b > a"
Else
    MsgBox "Else"
End If

Rather than:

If a > b Then
MsgBox “a > b”
ElseIf c > a
MsgBox “c > a”
ElseIf b > c Then
MsgBox “b > a”
Else
MsgBox “Else”
End If