-- -- ZoneView.scr -- -- Get user choice for which zone to select, -- then display all information about that zone. -- dir = get("app.path") cmd('model.load', dir .."\\Scripts\\Thermal_Example.eco") num_zones = get("model.zones") -- Build a table of zone names -- Note: zones in Ecotect are numbered from 0 -- default table indices in Lua start at 1 -- so we are explicitly setting the index in -- the tinsert command. names = {} for i = 0,num_zones-1 do tinsert(names, i, get("zone.name", i)) end -- Build a prompt for the dialog. -- Then get user's choice. msg = "Choose a Zone by Number:\n" for i = 0, num_zones-1 do msg = msg .. "\t" .. i .. ": " .. names[i] .. "\n" end selected_zone = getUserInput(msg, "") -- Get data for zone. zone_data = getZoneData(selected_zone) -- Print it out. for k,v in zone_data do print(k, v) end