Set up a workbook (Components)
PV modules
Import PAN files
// Load a PAN file and add the module specification to the workbook
const string panFilePath = @"C:\Data\Components\CanadianSolar_CS6U-330M_APP.PAN";
ModuleSpecification moduleSpec = ModuleSpecification.ReadPANFile(panFilePath);
Workbook.ComponentLibrary.ModuleSpecifications.Add(moduleSpec);
Inverters
Import OND files
// Load an OND file and add the inverter specification to the workbook
const string ondFilePath = @"C:\Data\Components\SSE_SP_S500KTL.OND";
InverterSpecification inverterSpec = InverterSpecification.ReadONDFile(ondFilePath);
Workbook.ComponentLibrary.InverterSpecifications.Add(inverterSpec);
String lengths
Set default string lengths
Not currently available
Fixed-tilt rack systems
Import a rack system specification
If you have previously saved a rack system specification to a file (using the Export button) you can load this back in using scripting.
RackSystemSpecification.ImportRackSystemSpecificationFileToWorkbook(string filePath)
// Import a rack system specification from a file
const string rackSystemSpecFilePath = @"C:\Data\Components\Rack System 20x3.RackSystemSpec";
RackSystemSpecification.ImportRackSystemSpecificationFileToWorkbook(rackSystemSpecFilePath);
Tracker systems
Import a tracker system specification
If you have previously saved a tracker system specification to a file (using the Export button) you can load this back in using scripting.
TrackerSystemSpecification.ImportTrackerSystemSpecificationFileToWorkbook(string filePath)
// Import a tracker system specification into the workbook
string trackerSystemSpecificationFilePath = @"C:\Data\Components\Tracker System 20x1.TrackerSystemSpec";
TrackerSystemSpecification.ImportTrackerSystemSpecificationFileToWorkbook(trackerSystemSpecificationFilePath);
Transformer specifications
Create a transformer specification
Create an object of type TransformerSpecification and add this to the component library.
// Create new transformer specification that uses a flat transformer effect
TransformerSpecification flatTransformerSpec = new TransformerSpecification
{
Name = "Flat transformer",
TransformerModelType = TransformerModelType.UseEffect,
TransformerEffect = -0.02, // -2% flat transformer effect
};
// Add the transformer specification to the workbook
Workbook.ComponentLibrary.TransformerSpecifications.Add(flatTransformerSpec);
// Create a new transformer that uses the full load/no load model (using % of rated power for losses)
TransformerSpecification fullAndNoLoadUsingPercentTransformerSpec = new TransformerSpecification
{
Name = "Full load/no load percent transformer",
TransformerModelType = TransformerModelType.UseFullLoadNoLoadModel,
RatedPower = 10000000, // in watts (10000000 = 1000 kW)
UseNoLoadPowerSpecifiedValue = false, // use the % of rated power
NoLoadPowerPercentageValue = 0.005, // 0.5% for the no load % of rated power loss
UseFullLoadPowerSpecifiedValue = false, // use the % of rated power
FullLoadPowerPercentageValue = 0.004, // 0.04% for the full-load % of rated power loss
};
// Add the transformer specification to the workbook
Workbook.ComponentLibrary.TransformerSpecifications.Add(fullAndNoLoadUsingPercentTransformerSpec);
// Create a new transformer that uses the full load/no load model (using kW value for losses)
TransformerSpecification fullAndNoLoadUsingSpecifiedValuesTransformerSpec = new TransformerSpecification
{
Name = "Full load/no load specified values transformer",
TransformerModelType = TransformerModelType.UseFullLoadNoLoadModel,
RatedPower = 10000000, // in watts (10000000 = 1000 kW)
UseNoLoadPowerSpecifiedValue = true, // use the value of rated power
NoLoadPowerSpecifiedValue = 50000, // in Watts (50000 = 50kW)
UseFullLoadPowerSpecifiedValue = true, // use the value of rated power
FullLoadPowerSpecifiedValue = 70000, // in Watts (70000 = 70kW)
};
// Add the transformer specification to the workbook
Workbook.ComponentLibrary.TransformerSpecifications.Add(fullAndNoLoadUsingSpecifiedValuesTransformerSpec);
Load a transformer specification
If you have previously saved a transformer specification to a file (using the Export button) you can load this back in using scripting.
TransformerSpecification.ReadTransformerSpecificationFile(string filePath)
// Load a previously exported transformer specification from a file
const string transformerSpecFilePath = @"C:\Data\Components\Flat transformer.TransformerSpec";
TransformerSpecification transformerSpec =
TransformerSpecification.ReadTransformerSpecificationFile(transformerSpecFilePath);
Workbook.ComponentLibrary.TransformerSpecifications.Add(transformerSpec);