Set up a workbook (Site)
Site location
Set the site location
Use the following function to set the site location:
Toolbox.SetSiteLocationAndAutomaticallySetProjection(double latitude, double longitude)
This also automatically sets the workbook projection (to the correct UTM zone for the location) and the time zone. Make sure you get the latitude and the longitude the right way around!
E.g.,
// Set site location of latitude of 24.928430 and longitude of 66.918926
Toolbox.SetSiteLocationAndAutomaticallySetProjection(24.928430, 66.918926);
Map backgrounds/terrain
Adding, downloading and removing map backgrounds and terrain is not currently supported in scripting.
Horizon line
Load horizon data from a file
// Load PVsyst-format horizon data from a file
const string pvSystHorizonFilePath = @"C:\Data\Components\TestHorizon.hor";
const bool isNorthernHemisphere = true;
HorizonData horizonData = HorizonData.ReadPVsystHorizonFile(pvSystHorizonFilePath, isNorthernHemisphere);
// Add the loaded horizon data to the workbook
Workbook.Domain.Geography.HorizonData.Add(horizonData);