### Output of running ModelChainAsyncTutorial.py Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Tutorials/ModelChainAsyncEndpointTutorial.html Example output from running the tutorial script. It shows the start time, API version check, input file paths, the POST request to start the calculation, the returned Instance ID, and the first polling response with runtime status Pending. ```text > python ModelChainAsyncTutorial.py Start time = 21-07-2022 16:09:49 Checking SF API version Sending GET request to https://solarfarmer.dnv.com/latest/api/About {'solarFarmerCoreVersion': '0.2.208.0', 'solarFarmerApiVersion': '0.2.242'} panFiles = C:\data\PythonTutorials\ModelChainAsync Endpoint\InputsFor3D\CanadianSolar_CS6U-330M_APP.PAN ondFiles = C:\data\PythonTutorials\ModelChainAsync Endpoint\InputsFor3D\PVP 260KW_NIST.OND Sending POST request to https://solarfarmer.dnv.com/latest/api/modelchainasync Instance ID returned = f24d771c933c45448dbf8f5fee3c26cb 1: Time: 0:00:02 Run status: Pending Custom status: Custom status not received No progress returned ``` -------------------------------- ### Example output from running the Service endpoint script Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Tutorials/ServiceEndpointTutorial.html Example output showing the response from the Service endpoint when the script is run successfully. It lists the number of services returned and their names. ```text Calling https://solarfarmer.dnv.com/latest/api/service 2 service(s) returned: ModelChain2D ModelChain3D ``` -------------------------------- ### SystemAttributes Example Output Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Endpoints/ModelChainEndpoint.html Example JSON output for the SystemAttributes property, detailing location, capacity, and version information. ```json { "location": { "longitude": -2.579543, "latitude": 51.452176, "altitude": 31.0 }, "acCapacityInMegawatts": 24.7, "dcCapacityInMegawatts": 30.096, "is3D": false, "mounting": "Single-axis trackers", "solarFarmerCoreVersion": "0.2.197.0", "solarFarmerApiVersion": "0.2.223" } ``` -------------------------------- ### Install SolarFarmer SDK via pip Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/PythonSDK/SdkIntroduction.html Use this command to install the SolarFarmer Python SDK package from PyPI. ```bash pip install dnv-solarfarmer ``` -------------------------------- ### Toolbox.Import Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the import functionality. ```APIDOC ## Property: Import ### Description Gets the import functionality. ### Declaration public static Import Import { get; } ### Property Value - **Type**: Import - **Description**: The import functionality. ``` -------------------------------- ### Pagination and ordering example: page 3, ordered by pNom descending Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/RclApi/RclEndpoint.html Example URL for requesting page 3 of 25-item pages, ordered by power rating descending. Uses the top, skip, orderBy, and orderDir query parameters. ```http GET /catalog/modules?**top=25&skip=50&orderBy=pNom&orderDir=DESC** ``` -------------------------------- ### Example response for paginated and ordered catalog modules request Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/RclApi/RclEndpoint.html Example response from the catalog modules endpoint when using pagination and ordering parameters. The response includes the items array and the total, skip, and top fields that indicate the data window. ```json { "items": [ { "manufacturer": "Canadian Solar Inc.", "model": "CS6U-325P", "pNom": 325, ... }, { "manufacturer": "Canadian Solar Inc.", "model": "CS6U-330M", "pNom": 330, ... }, { "manufacturer": "Canadian Solar Inc.", "model": "CS6U-330P", "pNom": 330, ... }, { "manufacturer": "Canadian Solar Inc.", "model": "CS6U-335M", "pNom": 335, ... }, { "manufacturer": "Canadian Solar Inc.", "model": "CS6U-335P", "pNom": 335, ... } ], "total": 122, "skip": 10, "top": 5 } ``` -------------------------------- ### ModelChain tutorial console output Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Tutorials/ModelChainEndpointTutorial.html Example console output from running the tutorial script for a fixed-tilt site. It shows the POST request, success message, annual energy yield totals, and the paths of the five output files written to the Outputs folder. ```text Sending POST request to https://solarfarmer.dnv.com/latest/api/ModelChain... Request has returned... SUCCESS: Calculation returned successfully Energy yield results totals for year: { "recordCount": 8760, "percentComplete": 99.99999999999983, "averageTemperature": 10.607920426907318, "ghi": 1192.7340000000002, "gi": 1373.3998258765, "giWithHorizon": 1373.3998258765307, "gainOnTiltedPlane": 0.15147201796589194, "globalEffectiveIrradiance": 1298.0776775552472, "modulePower": 556298.973838618, "modulePowerAtSTC": 578368.4783728, "nominalEnergy": 578293.605350863, "pdc": 535663.7904797235, "pac": 519353.412220547, "performanceRatio": 0.8218792979786185, "netEnergy": 502.86653814906, "energyYield": 1128.7688847353597 } Saved annual energy yield results to C:\Temp\Tutorials\Outputs\AnnualEnergyResults.json Sum EOutInv column in PVsyst format results to get total AC annual energy: 519353.579879 kWh Saved PVsyst results file to C:\Temp\Tutorials\Outputs\PVsystResults.csv Saved timeseries results file to C:\Temp\Tutorials\Outputs\TimeSeriesResults.tsv Saved loss tree results file to C:\Temp\Tutorials\Outputs\LossTreeResults.tsv Saved system attributes to C:\Temp\Tutorials\Outputs\System attributes.json ``` -------------------------------- ### YearRange.StartYear Property Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.YearRange.html Gets or sets the start year of the range. ```APIDOC ## StartYear Property ### Description Gets or sets the start year of the range. ### Declaration public int StartYear { get; set; } ### Property Value Type: System.Int32 ### Remarks None ``` -------------------------------- ### YieldResults.StartTime Property Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.YieldResults.html Gets or sets the start time of the yield results. ```APIDOC ## YieldResults.StartTime ### Description Gets or sets the start time of the yield results. ### Declaration ```csharp public DateTime StartTime { get; set; } ``` ### Property Value | Type | Description | |------|-------------| | System.DateTime | The start time. | ``` -------------------------------- ### Property StartTimeStamp Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.TrackerAlgorithmSummaryPeriod.html Gets or sets the start timestamp of the summary period. ```APIDOC ## Property StartTimeStamp ### Description Gets or sets the start timestamp of the summary period. ### Declaration ``` public DateTime StartTimeStamp { get; set; } ``` ### Property Value - **Type**: System.DateTime - **Description**: The start timestamp. ``` -------------------------------- ### SolarFarmer RCL API tutorial script output Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/RclApi/RclEndpointTutorial.html Example output from running the SolarFarmer RCL API tutorial script. Shows the catalog query response, download endpoint call, first 100 bytes of the downloaded file, and the remaining download count. The actual library contents, downloads remaining, and reset date will differ. ```text Calling: https://solarfarmer.dnv.com/rcl/catalog/inverters?top=3 Response received successfully. 90 of 100 downloads remaining. Resets: 2026-08-05 01:00:00 Number of items returned = 3 fileUuid of first item: 01e5ef3a-0d17-56eb-bff6-4bfa54476e9e filename of first item: "ABB_TRIO-60.0-TL-OUTD-480_APP01.OND" Calling download endpoint: https://solarfarmer.dnv.com/rcl/catalog/01e5ef3a-0d17-56eb-bff6-4bfa54476e9e Response from download received successfully. First 100 bytes of downloaded file content: b'PVObject_=pvGInverter\n Comment=ABB\tABB_TRIO-60.0-TL-OUTD-480_APP01\tDatasheet EN Rev. G 02.03.2017\n' 89 of 100 downloads remaining. Resets: 2026-08-05 01:00:00 Downloaded file saved as: "ABB_TRIO-60.0-TL-OUTD-480_APP01.OND" ``` -------------------------------- ### Toolbox.GetElevationProfileStatistics Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/Maps/ElevationProfileTool.html Gets the elevation profile statistics along a line defined by start and end points in workbook coordinates. Returns an ElevationProfileStatistics object. ```APIDOC ## Toolbox.GetElevationProfileStatistics ### Description Gets the elevation profile statistics (in the workbook coordinates projection) along the line from startPoint to endPoint. Returns an ElevationProfileStatistics object. ### Method Function call ### Signature ElevationProfileStatistics Toolbox.GetElevationProfileStatistics ( IReadable2DLocation startPoint, // in the workbook local projection IReadable2DLocation endPoint, // in the workbook local projection double maxSlopeThatIsConsideredFlat = 0.0); ### Parameters - **startPoint** (IReadable2DLocation) - Required - The start point (in workbook coordinates). - **endPoint** (IReadable2DLocation) - Required - The end point (in workbook coordinates). - **maxSlopeThatIsConsideredFlat** (double) - Optional - The maximum absolute slope value that is considered flat (defaults to 0.0). ### Returns ElevationProfileStatistics object for the elevation profile along the line. ``` -------------------------------- ### Run SolarFarmer with command-line arguments Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/UserGuide/HintsAndTips/RunSolarFarmerFromCommandLine.html Example command to open a workbook, execute a script, and close the application in invisible mode without a splash screen. ```bash GH.SolarFarmer.exe -open "C:\Workbooks\My workbook.sfw" -run MyScript ^ -close -invisible -nosplash ``` -------------------------------- ### Calculate and Log Elevation Profile Statistics Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/Maps/ElevationProfileTool.html This example demonstrates how to use Toolbox methods to calculate elevation statistics from two points and log the results using a helper method. ```csharp public void Execute() { // Use start and end points in the Workbook projection (e.g. UTM) Location startPointInWorkbookProjection = new Location(3564093.6, 2065754.3); Location endPointInWorkbookProjection = new Location(3564528.2, 2065414.5); ElevationProfileStatistics statistics = Toolbox.GetElevationProfileStatistics( startPointInWorkbookProjection, endPointInWorkbookProjection); Toolbox.Log("--- Summary of statistics when getting the statistics from two points in the" + " workbook projection"); OutputStatisticsSummary(statistics); // Use start and end points in latitude/longitude (WGS84) format // (don't forget when creating a Location, use the longitude (x) and latitude (y) Location startPointInLatLong = new Location(-77.752087, 38.252560); Location endPointInLatLong = new Location(-77.7566312, 38.254795); ElevationProfileStatistics statistics2 = Toolbox.GetElevationProfileStatisticsForLatLonPoints( startPointInLatLong, endPointInLatLong); Toolbox.Log("--- Summary of statistics when getting the statistics from two points in " + " latitude/longitude"); OutputStatisticsSummary(statistics2); } private void OutputStatisticsSummary(ElevationProfileStatistics statistics) { Toolbox.Log(string.Format( "Plan view distance: {0:0.##} m", statistics.PlanViewDistance)); Toolbox.Log(string.Format("Max up slope: {0:0.##} %", statistics.MaxUpSlope)); Toolbox.Log(string.Format("Max down slope: {0:0.##} %", statistics.MaxDownSlope)); Toolbox.Log(string.Format("Average up slope: {0:0.##} %", statistics.AverageUpSlope)); Toolbox.Log(string.Format( "Average down slope: {0:0.##} %", statistics.AverageDownSlope)); Toolbox.Log(string.Format( "Net elevation gain: {0:0.##} m", statistics.NetElevationGain)); Toolbox.Log(string.Format( "Point 15 slope: {0:0.##} %", statistics.SamplePoints[15].SlopeAtPoint)); Toolbox.Log(string.Format( "Point 15 dist from start: {0:0.##} m", statistics.SamplePoints[15].DistanceFromStart)); Toolbox.Log(string.Format( "Point 15 elevation: {0:0.##} m", statistics.SamplePoints[15].ElevationAtPoint)); } ``` -------------------------------- ### ProblemDetails validation error example Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Tutorials/ModelChainEndpointTutorial.html Example of a ProblemDetails structure returned when a validation error occurs, such as adding an extraOption property that doesn't exist. The errors property contains a list of validation messages. ```json { "type": "https: //tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-df8191bbcb0ca7829adfcf0c7632f208-03b5f2e811862f07-00", "errors": { "JSON Validation Error": [ "JSON validation issue: NoAdditionalPropertiesAllowed, Line number 1, Position 2970, Property: extraOption, Path: #/EnergyCalculationOptions.extraOption" ] } } ``` -------------------------------- ### Download equipment file from RCL catalog with Python Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/RclApi/RclEndpointTutorial.html The first block is the main Python script that queries the RCL catalog for the top 3 inverters, prints rate limit info, and downloads the first equipment file using its fileUuid. The second block is the line to replace with your own API token before running the script. Running this tutorial consumes one download from your monthly allowance. ```python import requests import json as json_module from datetime import datetime rcl_api_base_url = 'https://solarfarmer.dnv.com/rcl' catalog_url = f'{rcl_api_base_url}/catalog' catalog_modules_url = f'{catalog_url}/modules' catalog_inverters_url = f'{catalog_url}/inverters' api_token = 'ENTER YOUR API TOKEN HERE!!!' headers = {'Authorization': f'Bearer {api_token}'} def print_rate_limit_info(response): """ Extracts and prints the rate limit information from the HTTP response headers. """ rate_limit_remaining = response.headers.get('x-ratelimit-remaining') rate_limit_limit = response.headers.get('x-ratelimit-limit') rate_limit_reset = response.headers.get('x-ratelimit-reset') # Convert the rate limit reset time to a human-readable format rate_limit_reset_time = datetime.fromtimestamp(int(rate_limit_reset)).strftime('%Y-%m-%d %H:%M:%S') if rate_limit_reset else 'N/A' print(f"\n{rate_limit_remaining} of {rate_limit_limit} downloads remaining. Resets: {rate_limit_reset_time}") def download_equipment_file(fileUuid, file_name, print_start_of_file=True): """ Downloads a file from the catalog using its fileUuid and saves it to disk with the given file_name. Note that this will use one of your download limit. """ download_url = f'{catalog_url}/{fileUuid}' print(f"\nCalling download endpoint: {download_url}") try: download_response = requests.get(download_url, headers={'Authorization': f'Bearer {api_token}'}) download_response.raise_for_status() # Raise an exception for HTTP errors print("Response from download received successfully.") # The downloaded file content is in download_response.content. You can save it to a file if needed. # For demonstration, we'll just print the first 100 bytes of the content. if print_start_of_file: print(f"First 100 bytes of downloaded file content:\n{download_response.content[:100]}") # Print rate limit info for the download response as well print_rate_limit_info(download_response) # Save the downloaded file to disk (saves the bytes of the file directly). with open(file_name, 'wb') as f: f.write(download_response.content) print(f'Downloaded file saved as: "{file_name}"') except Exception as exc: print(f"Exception thrown when downloading {download_url} and saving to {file_name}") print(str(exc)) try: top_3_inverters_url = f'{catalog_inverters_url}?top=3' print(f"Calling: {top_3_inverters_url}") response = requests.get(top_3_inverters_url, headers=headers) response.raise_for_status() # Raise an exception for HTTP errors print("Response received successfully.") # Print the rate limit information from the response headers print_rate_limit_info(response) # Extract the 'items' list from the JSON response and print the number of items json = response.json() items = json.get('items', []) item_count = len(items) print(f"\nNumber of items returned = {item_count}") if item_count > 0: # Extract 'fileUuid' and 'filename' from the first item in the list first_item = items[0] fileUuid = first_item.get('fileUuid') file_name = first_item.get('filename') print(f"fileUuid of first item: {fileUuid}") print(f'filename of first item: "{file_name}"') # Call the download_equipment_file function to download the file using # its fileUuid and save it with the given filename download_equipment_file(fileUuid, file_name, print_start_of_file=True) except Exception as exc: print(f"Exception thrown when calling {top_3_inverters_url}") print(str(exc)) ``` ```python api_token = 'ENTER YOUR API TOKEN HERE!!!' ``` -------------------------------- ### Convert Unix timestamp to DateTime in C# and Python Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/RclApi/RclEndpoint.html Convert the Unix timestamp from the x-ratelimit-reset header into a DateTime object. The C# example uses DateTimeOffset.FromUnixTimeSeconds and the Python example uses datetime.fromtimestamp with UTC timezone. ```csharp DateTime resetDateTimeUtc = DateTimeOffset.FromUnixTimeSeconds(unixSeconds).UtcDateTime; ``` ```python from datetime import datetime, timezone dt = datetime.fromtimestamp(unixSeconds, tz=timezone.utc) print(dt) ``` -------------------------------- ### Module string and index output example Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/SetUpWorkbook/Layout.html This output shows the structure of module string data, including the inverter input, module string index, RackID, and X/Y indices within the rack. ```text InvInput: 0, number of module strings = 13 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 9, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 8, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 7, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 6, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 5, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 4, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 3, YIndexInRack = 0 ModuleString: 0, moduleIndex RackID: 49833, XIndexInRack = 2, YIndexInRack = 0 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 9, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 8, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 7, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 6, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 5, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 4, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 3, YIndexInRack = 1 ModuleString: 1, moduleIndex RackID: 49833, XIndexInRack = 2, YIndexInRack = 1 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 9, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 8, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 7, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 6, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 5, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 4, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 3, YIndexInRack = 2 ModuleString: 2, moduleIndex RackID: 49833, XIndexInRack = 2, YIndexInRack = 2 ModuleString: 3, moduleIndex RackID: 49833, XIndexInRack = 1, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49833, XIndexInRack = 0, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 9, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 8, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 7, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 6, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 5, YIndexInRack = 0 ModuleString: 3, moduleIndex RackID: 49832, XIndexInRack = 4, YIndexInRack = 0 ModuleString: 4, moduleIndex RackID: 49833, XIndexInRack = 1, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49833, XIndexInRack = 0, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49832, XIndexInRack = 9, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49832, XIndexInRack = 8, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49832, XIndexInRack = 7, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49832, XIndexInRack = 6, YIndexInRack = 1 ModuleString: 4, moduleIndex RackID: 49832, XIndexInRack = 5, YIndexInRack = 1 ... ``` -------------------------------- ### Example Output for Rack Coordinates Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/SetUpWorkbook/Layout.html This block shows the expected log output format for the rack corner coordinates retrieved by the previous code snippet. ```text Rack: ID=49833 P1 = 300602.76, 4661576.81, 78.00 P2 = 300602.76, 4661581.62, 81.38 P3 = 300592.84, 4661581.62, 81.38 P4 = 300592.84, 4661576.81, 78.00 Rack: ID=49832 P1 = 300612.78, 4661576.81, 78.00 P2 = 300612.78, 4661581.62, 81.38 P3 = 300602.86, 4661581.62, 81.38 P4 = 300602.86, 4661576.81, 78.00 Rack: ID=49831 P1 = 300622.80, 4661576.81, 78.00 P2 = 300622.80, 4661581.62, 81.38 P3 = 300612.88, 4661581.62, 81.38 P4 = 300612.88, 4661576.81, 78.00 Rack: ID=49830 P1 = 300632.82, 4661576.81, 78.00 P2 = 300632.82, 4661581.62, 81.38 P3 = 300622.90, 4661581.62, 81.38 P4 = 300622.90, 4661576.81, 78.00 ``` -------------------------------- ### Toolbox.Reporting Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the reporting functionality. ```APIDOC ## Property: Reporting ### Description Gets the reporting functionality. ### Declaration public static Reporting Reporting { get; } ### Property Value - **Type**: Reporting - **Description**: The reporting functionality. ``` -------------------------------- ### 3D PVPlant with InverterInputs and ModuleStrings Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Endpoints/ModelChainAsyncEndpoint.html Example of a 3D plant configuration with a transformer, an inverter, and module strings on the inverter. The Inverter object has an empty Layouts property, and the InverterInputs property contains ModuleStrings with ModuleIndexRange objects defining the string layout on racks/trackers. ```json "PVPlant": { "Transformers": [ { "TransformerSpecID": "Transformer Specification 1", "TransformerCount": 1, "Inverters": [ { "Name": "PV Powered PVP 260KW_NIST", "InverterSpecID": "PVP 260KW_NIST", "InverterCount": 1, "Layouts": [], "InverterInputs": [ { "ModuleSpecificationID": "CanadianSolar_CS6U-330M_APP", "ModuleStrings": [ { "ModuleIndexRanges": [ { "MountingID": 11137, "StartX": 11, "EndX": 0, "Y": 0 } ] }, { "ModuleIndexRanges": [ { "MountingID": 11137, "StartX": 11, "EndX": 0, "Y": 1 } ] }, ``` -------------------------------- ### Configure EnergyCalculationOptions Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/WebApi/Endpoints/ModelChainEndpoint.html Example of the required EnergyCalculationOptions object used to define the parameters for the energy calculation. ```json "EnergyCalculationOptions": { "CalculationYear": 2017, "DefaultWindSpeed": 0.0, "CalculateDHI": false, "IncludeHorizon": false, "DiffuseModel": "Perez", "TreatCircumsolarAsDirect": false, "UseMostShadedCellForDiffuse": false, "ModelBackRowSeparately": true, "ApplyIAM": true, "ApplySpectralMismatchModifier": false, "IncludeModulePerformance": true, "IncludeCellTemperatureModel": true, "IncludeSoilingLossInTemperatureModel": true, "UseIAMForTemperatureModel": false, "IncludeArrayIV": true, "IncludeInverterModel": true, "IncludeACModel": true, "GridAvailabilityLoss": 0.017, "AddTareLossToInverterEfficiencyModel": true, "IgnoreLowPowerPointInEfficiencyData": false, "ReturnPvSystFormatTimeSeriesResults": true, "ReturnDetailedTimeSeriesResults": false, "ReturnLossTreeTimeSeriesResults": false }, ``` -------------------------------- ### Toolbox.GeoSpatial Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the geospatial functionality. ```APIDOC ## Property: GeoSpatial ### Description Gets the geospatial functionality. ### Declaration public static GeoSpatial GeoSpatial { get; } ### Property Value - **Type**: GeoSpatial - **Description**: The geospatial functionality. ``` -------------------------------- ### Toolbox.Export Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the export functionality. ```APIDOC ## Property: Export ### Description Gets the export functionality. ### Declaration public static Export Export { get; } ### Property Value - **Type**: Export - **Description**: The export functionality. ``` -------------------------------- ### Ping command to test license server connectivity Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/UserGuide/Introduction/DesktopLicensing.html Run this command in a command prompt (cmd.exe) to verify that a machine can be used as a license server. Replace myLicenseServerMachineName with the machine name or IP address. Successful replies indicate the machine is reachable. ```bash ping myLicenseServerMachineName ``` -------------------------------- ### Temperature.InCelsius Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Temperature.html Gets the temperature in celsius. ```APIDOC ## Temperature.InCelsius ### Description Gets the temperature in celsius. ### Declaration public readonly double InCelsius { get; } ### Property Value - **Type**: System.Double ``` -------------------------------- ### RackInstanceInfos Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.LayoutBoundary.html Gets the rack instance infos for the SiteLayout. ```APIDOC ## RackInstanceInfos ### Description Gets the rack instance infos for the SiteLayout. ### Declaration ```csharp public IEnumerable RackInstanceInfos { get; } ``` ### Property Value | Type | Description | |------|-------------| | System.Collections.Generic.IEnumerable | The rack instance infos. | ``` -------------------------------- ### Import PAN file for PV modules Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/SetUpWorkbook/Components.html Loads a PAN file and adds the module specification to the workbook using Toolbox.Import.ImportPANModuleSpecificationFileIntoWorkbook. ```csharp // Load a PAN file and add the module specification to the workbook const string panFilePath = @"C:\Data\Components\CanadianSolar_CS6U-330M_APP.PAN"; Toolbox.Import.ImportPANModuleSpecificationFileIntoWorkbook(panFilePath); ``` -------------------------------- ### Pitch Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.SpacingZone.html Gets or sets the pitch. ```APIDOC ## Pitch ### Description Gets or sets the pitch. ### Declaration ```csharp public double Pitch { get; set; } ``` ### Property Value | Type | Description | |------|-------------| | System.Double | The pitch. | ``` -------------------------------- ### YieldResults.GetHashCode() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.YieldResults.html Gets the hash code for this object. ```APIDOC ## YieldResults.GetHashCode() ### Description Gets the hash code for this object. ### Declaration ```csharp public override int GetHashCode() ``` ### Returns | Type | Description | |------|-------------| | System.Int32 | The hash code for this object. | ### Overrides System.Object.GetHashCode() ``` -------------------------------- ### Run energy calculation with current settings Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/Calculation/RunEnergyCalculation.html Runs the energy calculation using the current site layout, solar resource, and horizon data from the calculation settings. The scenario name is passed as the first argument. ```csharp EnergyYieldCalculationScenario scenario = Toolbox.ExecuteEnergyCalculation( "Scenario 1", Workbook.CalculationSettings.SolarResource, Workbook.CalculationSettings.SiteLayout, Workbook.CalculationSettings.HorizonData); ``` -------------------------------- ### Toolbox.TrackerImport Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the tracker import functionality. ```APIDOC ## Property: TrackerImport ### Description Gets the tracker import functionality. ### Declaration public static TrackerImport TrackerImport { get; } ### Property Value - **Type**: TrackerImport - **Description**: The tracker import functionality. ``` -------------------------------- ### SiteLayout() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.SiteLayout.html Creates an instance of the SiteLayout class. ```APIDOC ## SiteLayout() ### Description Creates an instance of the SiteLayout class. ### Method Constructor ### Declaration ``` public SiteLayout() ``` ``` -------------------------------- ### Toolbox.GeometryToolkit Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Toolbox.html Gets the geometry toolkit functionality. ```APIDOC ## Property: GeometryToolkit ### Description Gets the geometry toolkit functionality. ### Declaration public static GeometryToolkit GeometryToolkit { get; } ### Property Value - **Type**: GeometryToolkit - **Description**: The geometry toolkit functionality. ``` -------------------------------- ### Print monthly albedo values to log using Toolbox.Log Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/SetUpWorkbook/Climate.html Iterates over the MonthlyAlbedoValues collection and logs each month and its albedo value using Toolbox.Log. Useful for verifying the configured monthly albedo values. ```csharp // Print out the monthly albedo values to the log foreach (MonthlyAlbedo monthlyAlbedo in Workbook.Domain.Geography.MonthlyAlbedoValues) { Toolbox.Log(string.Format("Month = {0}, Value = {1}", monthlyAlbedo.Month, monthlyAlbedo.AlbedoValue)); } ``` -------------------------------- ### TimeZoneName Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.SolarResource.html Gets or sets the name of the timezone. ```APIDOC ## TimeZoneName ### Description Gets or sets the name of the timezone. ### Declaration ``` public string TimeZoneName { get; set; } ``` ### Property Value - **Type**: System.String ``` -------------------------------- ### PitchModel Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.SpacingZone.html Gets or sets the pitch model. ```APIDOC ## PitchModel ### Description Gets or sets the pitch model. ### Declaration ```csharp public LayoutParamsPitchModel PitchModel { get; set; } ``` ### Property Value | Type | Description | |------|-------------| | LayoutParamsPitchModel | The pitch model. | ``` -------------------------------- ### Initialise() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.CustomDateTimeTrackerPositionAlgorithmBase.html Performs any initialization before any tracker positions are calculated. Override in the derived class. ```APIDOC ## Initialise() ### Description Performs any initialization before any tracker positions are calculated. Override in the derived class. ### Method Initialise ### Parameters None ### Returns System.Boolean - `true` if initialization succeeds; otherwise `false` if an error occurred. ``` -------------------------------- ### TrackerLayoutParameters Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.LayoutBoundary.html Gets the tracker layout parameters. ```APIDOC ## TrackerLayoutParameters ### Description Gets the tracker layout parameters. ### Declaration ```csharp public TrackerLayoutParameters TrackerLayoutParameters { get; } ``` ### Property Value | Type | Description | |------|-------------| | TrackerLayoutParameters | The tracker layout parameters. | ``` -------------------------------- ### Constructor TrackerAlgorithmSummaryPeriod() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.TrackerAlgorithmSummaryPeriod.html Creates an instance of the TrackerAlgorithmSummaryPeriod class. ```APIDOC ## Constructor TrackerAlgorithmSummaryPeriod() ### Description Creates an instance of the TrackerAlgorithmSummaryPeriod class. ### Declaration ``` public TrackerAlgorithmSummaryPeriod() ``` ### Parameters None. ### Returns A new instance of the TrackerAlgorithmSummaryPeriod class. ``` -------------------------------- ### Setback Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.LayoutBoundary.html Gets or sets the setback distance. ```APIDOC ## Setback ### Description Gets or sets the setback distance. ### Declaration ```csharp public double Setback { get; set; } ``` ### Property Value | Type | Description | |------|-------------| | System.Double | The setback distance. | ``` -------------------------------- ### RackLayoutParameters Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.LayoutBoundary.html Gets the rack layout parameters. ```APIDOC ## RackLayoutParameters ### Description Gets the rack layout parameters. ### Declaration ```csharp public RackLayoutParameters RackLayoutParameters { get; } ``` ### Property Value | Type | Description | |------|-------------| | RackLayoutParameters | The rack layout parameters. | ``` -------------------------------- ### Domain() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Domain.html Initializes a new instance of the Domain class. ```APIDOC ## Domain() ### Description Creates an instance of the Domain class. ### Declaration ```csharp public Domain() ``` ``` -------------------------------- ### Initialize Layout Parameters Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/Layout/DefiningInverterBlocks.html Create and initialize the necessary parameters for central inverter location, roads, margins, and string assignment before applying them to a layout region. ```csharp // Create and initialise the central inverter location parameters CentralInverterLocationParameters inverterLocationParams = new CentralInverterLocationParameters { DistanceTypeFromTop = DistanceType.PercentageAcrossLength, TopValue = 50.0, DistanceTypeFromLeft = DistanceType.PercentageAcrossLength, LeftValue = 50.0, }; // Create and initialise the vertical and horizontal road parameters RoadLocationParameters verticalRoadParams = new RoadLocationParameters { DistanceType = DistanceType.Count, DistanceValue = 3, RoadWidth = 5.0, }; RoadLocationParameters horizontalRoadParams = new RoadLocationParameters { DistanceType = DistanceType.Count, DistanceValue = 3, RoadWidth = 5.0, }; // Create and initialise the margin parameters LayoutBoundaryMarginParameters margins = new LayoutBoundaryMarginParameters( new LayoutBoundaryMarginParameter(MarginType.HalfRowColumn, 0), // Top new LayoutBoundaryMarginParameter(MarginType.HalfRowColumn, 0), // Bottom new LayoutBoundaryMarginParameter(MarginType.Custom, 0), // Left new LayoutBoundaryMarginParameter(MarginType.Custom, 0)); // Right // Create and initialise the central inverter and strings parameters AddCentralInverterAndAssignStringsParameters addInverterParams = new AddCentralInverterAndAssignStringsParameters { InverterSpecification = Workbook.ComponentLibrary.InverterSpecifications[0], ModuleSpecification = Workbook.ComponentLibrary.ModuleSpecifications[0], StringLength = 12, StringPatternType = StringPatternType.Straight, }; ``` -------------------------------- ### ReadOnly3DLocation.GetHashCode() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.ReadOnly3DLocation.html Gets the hash code for this object. ```APIDOC ## Method: GetHashCode() ### Description Gets the hash code for this object. ### Declaration public override int GetHashCode() ### Returns - Type: System.Int32 - Description: The hash code. ### Overrides ReadOnlyLocation.GetHashCode() ``` -------------------------------- ### Set up calculation settings for energy yield Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/SetUpWorkbook/Energy.html Configures the calculation settings for the energy yield calculation by assigning the visible site layout, the first solar resource, and the first horizon data, and enabling the horizon line. Use this before running the calculation. ```csharp CalculationSettings calcSettings = Workbook.CalculationSettings; // Set the site layout to use calcSettings.SiteLayout = Workbook.Domain.VisibleSiteLayout; // Set the solar resource calcSettings.SolarResource = Workbook.Climate.SolarResources.First(); // Set the horizon calcSettings.HorizonData = Workbook.Domain.Geography.HorizonData.First(); calcSettings.UseHorizonLine = true; ``` -------------------------------- ### ReportCategory.GetHashCode() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.ReportCategory.html Gets the hash code for this object. ```APIDOC ## ReportCategory.GetHashCode() ### Description Gets the hash code for this object. ### Declaration public override int GetHashCode() ### Returns - **Type**: System.Int32 - The hash code for this object. ### Overrides System.Object.GetHashCode() ``` -------------------------------- ### Region.Name Property Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Region.html Gets the name of the region. ```APIDOC ## Region.Name Property ### Description Gets the name of the region. ### Declaration `public string Name { get; }` ### Property Value - **Type**: System.String ``` -------------------------------- ### Stringing an Optimised Layout with Specify Site Tool Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/SfScripting/CodeSnippets/Optimisation/OptimisationTargetDcCapacityComplexTerrain.html This script adds necessary electrical components to a layout, estimates module and inverter counts based on DC capacity, and updates the site layout configuration. ```csharp // Add transformer and inverters to the optimised layout. // If not defined in the layout, add transformer instance to the layout // (placed an offset from the bottom left coordinate of the first layout) int trafoNb = finalSiteLayout.TransformerInstances.Count(); if (trafoNb == 0) { double offsetForTransformer = 500; double trafoX = templateSiteLayout.LayoutBoundaries.First() .Bounds.BottomLeft.X - offsetForTransformer; double trafoY = templateSiteLayout.LayoutBoundaries.First() .Bounds.BottomLeft.Y - offsetForTransformer; finalSiteLayout.AddTransformerInstance(new Location(trafoX, trafoY), Workbook.ComponentLibrary.TransformerSpecifications.First()); } // Select library components ModuleSpecification moduleSpecification = Workbook.ComponentLibrary.ModuleSpecifications .First(s => s.Name.Contains(moduleName)); InverterSpecification inverterSpecification = Workbook.ComponentLibrary.InverterSpecifications .First(s => s.Name.Contains(inverterName)); double layoutRegionModulePower = moduleSpecification.Pnom; // in Watts double inverterNominalPower = inverterSpecification.PnomAC / 1000; // in kW // Specify site tool - the layout regions will be filled by component numbers. // The algorithm estimates the numbers of components needed based on the estimated DC capacity in each layout. SpecifySiteDefinition specifySiteDefinition = new SpecifySiteDefinition { // Choose how to fill. We'll choose 'Specify by Module and Inverter Counts' SpecifySiteConfiguration = SpecifySiteConfiguration.SpecifyModuleAndInverterCounts, // Set how to fill the layout regions (we use 'fill specific layout regions') SpecifySiteLayoutRegionFillChoice = SpecifySiteLayoutRegionFillChoice.FillSpecific, }; List arrayListForSpecifyTool = new List(); // Iterate over each layout region and estimate the number of strings in each inverter. // It accounts for irregular string distribution (uneven DC/AC ratio) among inverters. for (int i = 0; i < finalSiteLayout.LayoutBoundaries.Count(); i += 1) { string layoutRegionName = finalSiteLayout.LayoutBoundaries.ElementAt(i).Name; // Estimate total number of strings double dcCapacityInLayoutRegion = finalSiteLayout.Statistics. LayoutBoundaryStatistics[i].EstimatedDcCapacity; double numberModules = dcCapacityInLayoutRegion * 1000 / layoutRegionModulePower; int totalStringNumberInLayout = (int)numberModules / stringLength; // Estimate total number of full inverters double AcCapacityExpected = dcCapacityInLayoutRegion / desiredDcAcRatio; int numberInvertersFull = (int)Math.Round(AcCapacityExpected / inverterNominalPower, 0); double AcCapacityApplied = inverterNominalPower * (double)numberInvertersFull; Toolbox.Log(string.Format("{0}, DC power {1}, AC power {2} (DC/AC ratio: {3}), " + "inverters {4}, strings {5}", layoutRegionName, dcCapacityInLayoutRegion, AcCapacityApplied, Math.Round(dcCapacityInLayoutRegion / AcCapacityApplied, 3), numberInvertersFull, totalStringNumberInLayout)); // Estimate the string distribution over the inverters in the layout region int[] initialAssignment = DistributeStrings(totalStringNumberInLayout, numberInvertersFull, invertersDifferentIfIrregularLoading, evenLoading); Toolbox.Log(string.Format("Distribution of strings in the {0} inverter(s) of the layout region:", numberInvertersFull)); Toolbox.Log(string.Join(", ", initialAssignment)); List arraysInLayout = GetSpecificArrayNumbers(initialAssignment, stringLength, layoutRegionName); arrayListForSpecifyTool.AddRange(arraysInLayout); } Toolbox.Log("Summary - Array details used in the Specify Site Tool:"); foreach (SubArray subarray in arrayListForSpecifyTool) { Toolbox.Log(subarray.SelectedLayoutRegionNames.First().ToString()); Toolbox.Log("\t" + subarray.Name.ToString()); Toolbox.Log("\t" + subarray.NumberOfModules_Input.ToString() + " modules and " + subarray.NumberOfInverters_Input.ToString() + " inverters"); specifySiteDefinition.SubArrays.Add(subarray); } finalSiteLayout.UpdateFromSpecifySiteDefinition(specifySiteDefinition); finalSiteLayout.RemoveAllEmptyRacksOrTrackers(); // Set the optimised layout in the screen: Energy -> Layout and resources, Site layout. Workbook.CalculationSettings.SiteLayout = finalSiteLayout; ``` -------------------------------- ### ReadOnly3DLocation.HeightAboveGround Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.ReadOnly3DLocation.html Gets the height above ground for the location. ```APIDOC ## Property: HeightAboveGround ### Description Gets the height above ground. ### Declaration public double HeightAboveGround { get; } ### Property Value - Type: System.Double - Description: The height above ground. ``` -------------------------------- ### Projection.GetHashCode() Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Projection.html Gets the hash code for this object. ```APIDOC ## Projection.GetHashCode() ### Description Gets the hash code for this object. ### Method GetHashCode ### Signature public override int GetHashCode() ### Returns - **System.Int32** - The hash code for this object. ### Overrides System.Object.GetHashCode() ``` -------------------------------- ### Point4 Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Quad.html Gets the fourth point of the Quad. ```APIDOC ## Point4 ### Description Gets the fourth point of the Quad. ### Declaration public Point3D Point4 { get; } ### Property Value Type: Point3D ``` -------------------------------- ### Point3 Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Quad.html Gets the third point of the Quad. ```APIDOC ## Point3 ### Description Gets the third point of the Quad. ### Declaration public Point3D Point3 { get; } ### Property Value Type: Point3D ``` -------------------------------- ### Y Property Source: https://mysoftware.dnv.com/download/public/renewables/solarfarmer/manuals/latest/api/Scripting.Location.html Gets or sets the location Y value. ```APIDOC ## Y Property ### Description Gets or sets the location Y value. ### Declaration public double Y { get; set; } ### Property Value Type: System.Double ```