Skip to main content

Actions

Actions that can be executed to interact with CAD or Aurora Solar.

All actions are asynchronous and return a promise. Use await or .then to handle the resolved value and ensure proper execution order.

downloadScreenshot

Save a screenshot of the current CAD window. The size and resolution will be the same as it is on the current screen. By default, local file download will be triggered for the user with the resulting PNG image. To disable this, set the downloadLocally option to false.

This screenshot is retrievable with the List Assets API endpoint.

Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

await design.downloadScreenshot();

// To prevent a local file download:
await design.downloadScreenshot({ downloadLocally: false });

Signature

downloadScreenshot([options]);

Parameters

parametertypenote
options
objectDetailed in Options below.

Screenshot Options

nametypenote
downloadLocally
booleanEnable or disable local file download (defaults to true)

Returns

A promise that resolves when the screenshot has been downloaded and saved to the design.

DownloadScreenshot Errors

messagedescription
DownloadScreenshot timed out while waiting for map imagery to loadThe screenshot function timed out while waiting for map imagery to load. This may be due to a connectivity issue or an issue with the imagery API.

runAutoDesigner

Save a design and run AutoDesigner on it.

runAutoDesigner Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

/**
* Run AutoDesigner in max fit mode:
*/
const autoDesignerMaxFitOptions = {
components: {
solarPanels: ['<solar-panel-id>'],
},
mode: 'max_fit',
placementOptions: {
orientations: ['landscape'],
},
},

const maxFitResult = await design.runAutoDesigner(autoDesignerMaxFitOptions);

/**
* Run AutoDesigner in energy target mode:
*/
const autoDesignerEnergyTargetOptions = {
mode: 'energy',
target: 20000,
components: {
solarPanels: ['<solar-panel-id>'],
microInverters: ['<microinverter-id>'],
},
placementOptions: {
orientations: [
'portrait'
]
}
};

const energyTargetResult = await design.runAutoDesigner(autoDesignerEnergyTargetOptions);

/**
* Run AutoDesigner in hybrid mode (max fit with an energy target):
*/
const autoDesignerHybridOptions = {
components: {
solarPanels: ['<solar-panel-id>'],
},
mode: 'max_fit',
target: 20000,
placementOptions: {
orientations: ['landscape'],
},
},

const maxFitResult = await design.runAutoDesigner(autoDesignerHybridOptions);

runAutoDesigner Signature

runAutoDesigner([options]);

runAutoDesigner Parameters

parametertypenote
options
(required)
objectDetailed in Options below.

runAutoDesigner Returns

A promise that resolves when AutoDesigner has completed.

AutoDesigner Options

There are currently 3 mode options available for AutoDesigner:

  • max_fit: Places the maximum number of panels possible within the constraints passed in through placement_options.

    • Only takes solarPanels in the components input option, will ignore other components such as inverters.
    • You may optionally attach a microinverter to all panels by specifying one in your tenant settings (the "Add Microinverters" field in the Aurora Solar App admin settings.
  • energy: Places components to generate energy production that is as close as possible to the provided energy target (in kWh) within the constraints passed in through placementOptions.

  • hybrid: When specifying both mode: "max_fit" and an energy target, the algorithm will attempt to place the maximum number of panels possible within the constraints passed in through placementOptions, and then disable any panels that are not needed to meet the energy target.

nametypenote
components
(required)
objectDetailed in AutoDesigner Components below
modestringThe optimization mode, choose between ["max_fit", "energy"].
targetnumberTarget energy, in kWh. Can be used in either mode.
placementOptionsobjectDetailed in Placement Options below

AutoDesigner Components

Note that in max-fit mode, inverters specified via the components object are not used.

In order to find the IDs for components to use, you need to use the Aurora application.

Go to the Aurora database page for a list of all components, or for specific types, see the following pages:

We also provide a utility method within the SDK for getting a list of your tenant's "starred/checked" components within the database pages. See this page on fetching Components for more details.

nametypenote
dcOptimizersArray<string>Array of DC Optimizer IDs to use within design
stringInvertersArray<string>Array of String Inverter IDs to use within design
microInvertersArray<string>Array of Micro Inverter IDs to use within design
solarPanelsArray<string>Array of Solar Panel IDs to use within design

Placement Options

nametypenote
allowFillerRowbooleanAllow a row of panels with opposite orientation on top or bottom of the panel layout if it improves the result.
columnSpacingMetersnumberDistance between columns of panels, in meters. Default 0.
flatFaceColumnSpacingMetersnumberDistance between columns of panels, in meters, when a roof face is below the threshold to consider it pitched. Default 0.
flatFaceOrientationsArray<string>Allowable orientations of panels when a roof face is below the threshold to consider it pitched. May contain any combination of ["portrait", "landscape"].
flatFacePanelTiltDegreesnumberThe tilt of panels relative to the roof surface, in degrees. Applies to flat roof faces. Minimum 0, maximum 80 degrees. Default 0.
flatFaceRowSpacingMetersnumberDistance between rows of panels, in meters, when a roof face is below the threshold to consider it pitched. Default 0.
minAzimuthDegreesnumberThe minimum roof azimuth upon which panels are allowed to be placed, where 0 is north and 180 is south.
maxAzimuthDegreesnumberThe maximum roof azimuth upon which panels are allowed to be placed, where 0 is north and 180 is south.
minContiguousPanelsnumberMinimum number of contiguous panels in every row. Mode must be energy for this option.
minSapnumberMinimum solar access percentage of panels, expressed as a decimal between 0 and 1. Default 0.
minTsrfnumberMinimum total solar resource fraction of panels, expressed as a decimal between 0 and 1. Default 0.
panelTiltDegreesnumberThe tilt of panels relative to the roof surface, in degrees. Applies to pitched roof faces. Minimum 0, maximum 80 degrees. Default 0.
pitchedFaceTiltThresholdDegreesnumberAzimuth threshold above which a roof face is considered pitched, in degrees. Minimum 0, maximum 80 degrees. Default 0.*
orientationsArray<string>Allowable orientations of panels. May contain any combination of ["portrait", "landscape"].
rowSpacingMetersnumberDistance between rows of panels, in meters. Default 0.

* If this option is set to 0, a roof face with a pitch of 0 degrees will still be considered flat. Anything greater than 0 will be pitched.

AutoDesigner Errors

messagedescription
Could not place panels meeting specified SAP, TSRF thresholdsThe roof model is not adequate to to standards set in the placement options. If the roof model seems accurate, this issue could be addressed by adjusting the placement options.
Roof is too small to place any panelsThis error may occur if a broken roof model is created. Try re-running AI Roof with the clear parameter to resolve this issue if it happens intermittently.
Invalid AutoDesigner optionsThe format of the placement options is incorrect, or a required option is missing.

runAutoStringer

Automatically string together a group of panels, connect them to an inverter(s), and save the design.

Specify either 1-3 string inverters and an optional DC optimizer or 1-3 microinverters. AutoStringer will choose the best combination of components for your site and panels. The components you choose already have DC/AC Ratio and Max/Min string lengths set as properties, but you can override them if you choose.

Note that this action will remove all existing strings and inverters in the design before placing new ones. Also, it will automatically toggle off any panels that could not be strung due to electrical constraints.

runAutoStringer Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.create(projectId, 'Design Name');

// Specify up to 3 inverters:
await design.runAutoStringer({
components: {
dcOptimizers: ['dc-optimizer-id'], // optional
stringInverters: ['string-inverter-id-1', 'string-inverter-id-2', 'string-inverter-id-3'],
},
});

// Optionally override default electrical parameters for the inverters by passing them as an object with the specified keys
await design.runAutoStringer({
components: {
dcOptimizers: ['dc-optimizer-id'], // optional
stringInverters: [
'string-inverter-id-1',
{
id: 'string-inverter-id-2',
dcAcRatio: 1.2,
maxStringLength: 10,
minStringLength: 4,
},
'string-inverter-id-3',
],
},
});

// Use microinverters rather than string inverters. These do not accept overrides:
await design.runAutoStringer({
components: {
dcOptimizers: ['dc-optimizer-id'], // optional
microInverters: ['microinverter-id-1', 'microinverter-id-2', 'microinverter-id-3'],
},
});

runAutoStringer Signature

runAutoStringer(options);

runAutoStringer Parameters

parametertypenote
optionsobjectDetailed in Options below.

runAutoStringer Returns

A promise which resolves when AutoStringer has finished. The promise may reject with an error message if AutoStringer fails.

AutoStringer Options

nametypenote
componentsobjectDetailed in AutoStringer Components below.

AutoStringer Components

nametypenote
dcOptimizersArray<string>Array of DC Optimizer IDs to use within design. Optional.
stringInvertersArray<string> or Array<object>Array of String Inverter IDs or override objects to use within design. See AutoStringer Overrides below.
microInvertersArray<string>Array of Micro Inverter IDs to use within design

Note that only one of stringInverters or microInverters may be specified, with up to 3 inverter components. Note that users must specify at least one inverter component. DC optimizers are optional.

AutoStringer Overrides

Except for the component id, any of these override parameters may be left undefined to use a default value which differs based on the component used.

nametypenote
idstringID of the inverter to use within design. Required.
dcAcRationumberDC/AC ratio of the inverter. Leave undefined to use the default value for this component.
maxStringLengthnumberMaximum number of panels to string together. Leave undefined to use the default value for this component.
minStringLengthnumberMinimum number of panels to string together. Leave undefined to use the default value for this component.

AutoStringer Errors

messagedescription
Component ID not found in databaseCheck to make sure you are using correct Component ID.
Too many DC optimizers. 0 or 1 requiredCheck to make sure you are not passing in more than 1 DC optimizer.
Cannot request both DC optimizers and microinvertersAutoStringer can only accept either DC optimizers or microinverters on a given run.
Cannot request both string inverters and microinvertersAutoStringer can only accept either string inverters or microinverters on a given run.
Not enough inverters (minimum: 1 string inverter or 1 microinverter)Make sure you submit at least 1 inverter.
Too many string inverters (maximum: 3)AutoStringer cannot accept more than 3 string inverters.
Too many microinverters (maximum: 3)AutoStringer cannot accept more than 3 microinverters.
Selected solar panels already have integrated microinvertersThe selected solar panels already have an integrated microinverters. Include only string inverters as input to AutoStringer.
Selected solar panels already have integrated optimizersThe selected solar panels already have an integrated optimizer. Include only string inverters as input to AutoStringer.
Too many solar panel models selected (maximum: 1)AutoStringer can string only one panel model at once.
Not enough solar panels (minimum: 2)AutoStringer requires at least 2 solar panels.
String to inverter assignment ILP failedString inverter and DC Optimizer are incompatible. Choose different components.

runAutoRoof

Run AI Roof on a design and save it.

runAutoRoof Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.create(projectId, 'Design Name');

const result = await design.runAutoRoof();

// To clear system design and roof models before running AI Roof:
const result = await design.runAutoRoof({ clear: true });

runAutoRoof Signature

runAutoRoof(options);

runAutoRoof Parameters

parametertypenote
optionsobjectDetailed in Options below.

runAutoRoof Returns

A promise which resolves when AI Roof has finished. The promise may reject with an error message if AI Roof fails.

AutoRoof Options

nametypenote
clear
booleanClear existing system design and roofs prior to running AI Roof
skipOodLidar
booleanIgnore Lidar Out of Date errors and continue creating a roof model

AI Roof Errors

messagedescription
LIDAR/HD imagery not availableImagery is not yet available for this address and AI Roof will not be able to model a roof. Ensure that the address (pin) for the design is accurate. In the Aurora App, toggle the type of imagery to see if a different type is available.
Unknown error occuredAn unknown AI Roof error occurred. This may be resolved in some instances by the same means as the "LIDAR/HD imagery not available" error.
Lidar Out of DateThe LIDAR imagery for this site does not align with the map imagery, and AI Roof models would be inaccurate. A roof for this site must be created manually.
AI won't work for this siteAn error occurred with the AI roof algorithm. A roof for this site must be created manually.
No imagery chosenThere is no imagery type chosen for this design, or the imagery failed to load. It may be addressed by re-creating the project or design from scratch after ensuring that an imagery type is selected in the Aurora App.

runIrradiance

Save a design, then run roof and panel irradiance analysis on it. The analysis will update irradiance maps visible in the CAD screen and shading data in the design summary available via Aurora REST API.

runIrradiance Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

const result = await design.runIrradiance();

runIrradiance Signature

runIrradiance(options?: Options);

runIrradiance Parameters

The options object has properties that are as follows:

nametypenotes
timeoutMsnumberTime to wait before failing the action, in milliseconds. Default is 120,000 ms (two minutes).

runIrradiance Returns

A promise which returns when irradiance has finished calculating.

The promise wraps an object including some shading data:

nametypenotes
irradiancenumberAverage irradiance
solarAccessnumberAverage solar access percentile
tsrfnumberTotal Solar Resource Fraction

Irradiance Errors

messagedescription
Irradiance Error: (message)An error has occured in the irradiance service; the message will specify the cause of the error or 'Unknown Error'
Irradiance cannot be runThe irradiance job cannot be started, most likely because the current irradiance maps are still valid

Viewing Irradiance Maps

The irradiance maps must be toggled on using the toggleView API before using the runIrradiance method in order to guarantee the data will be populated.

In addition, toggling on the irradiance map texture for panels will automatically run the irradiance analysis job if the data is stale.

runPerformanceSimulation

Save a design and run performance simulation on it.

The action simulates the operation of the system and determines its energy production. It also accounts for the impact of shading from buildings, trees, and obstructions. Performance simulation is a self-contained action that doesn't depend on other Client SDK actions such as runIrradiance.

runPerformanceSimulation Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

const result = await design.runPerformanceSimulation();

runPerformanceSimulation Signature

runPerformanceSimulation();

runPerformanceSimulation Returns

A promise which resolves with the following object when the performance simulation has finished.

nametypenote
annualnumberTotal annual energy production
monthlyArray<number>Energy production broken down by month

startSunAnimation

The animation begins at noon on the summer solstice, which is June 21 and Dec 22 for projects with addresses in Northern and Southern Hemisphere, respectively.

The startSunAnimation method can take a parameter indicating the animation mode. This changes the path the sun will animate on. Valid parameters include 'month' and 'hour'.

The animation mode will default to 'month' if no parameter is provided.

startSunAnimation Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

design.startSunAnimation();

startSunAnimation Signature

startSunAnimation(animationMode);

startSunAnimation Returns

Promise<void>

stopSunAnimation

stopSunAnimation Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

design.stopSunAnimation();

stopSunAnimation Signature

stopSunAnimation();

stopSunAnimation Returns

Promise<void>

Undo/Redo

Undo/Redo Usage

const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);

design.undo();
design.redo();

Undo/Redo Signature

undo();
redo();

Undo/Redo Returns

Promise<void>

modifySolarPanels

Disable, enable, and remove solar panels in the design based on their position on a roof face.

The method expects a callback function, which is provided with a panel layout as input. The panel layout contains all the roof-based panels in the design grouped by their roof face. Each panel contains roof position information as well as methods to modify them. Calling a panel's modify methods (disable(), enable(), remove()) marks that panel for modification. All modifications are applied together and saved after the callback function resolves. The method returns a promise that contains the total counts of all of the panels that were modified.

modifySolarPanels Usage

const result = await design.modifySolarPanels((layout) => {
// The layout contains an array of roof faces.
layout.roofFaces.forEach((roofFace) => {
// Each roof face contains an array of panels
const panel = roofFace.panels[0];

// Use the panel's position on the roof to determine if it should be modified
if (panel.roofFaceX > 10) {
panel.disable();
} else {
panel.remove();
}
});
});

modifySolarPanels signature

const modifiedTotals = await design.modifySolarPanels(callback);

modifySolarPanels Parameters

nametypenote
callbackfunctionA function (or async function) that receives a panel layout that can be used to modify panels. When this function resolves, the layout becomes obsolete.

modifySolarPanels Returns

The method returns a Promise that resolves with the total numbers of modified panels. If panels that were already enabled are marked to be enabled they will not be modified and therefore not be reflected in the totals. Likewise, disabled panels marked to be disabled will not be reflected in the totals.

type ModifySolarPanelResponse = Promise<{
panelsDisabled: number;
panelsEnabled: number;
panelsRemoved: number;
}>;

modifySolarPanels Callback

A function or async function that is passed a ModifySolarPanelsLayout object. The layout provides panels grouped by their roof faces. Each panel contains positioning information as well as methods to modify the panel.

Once this function finishes executing, or once the promise it returns has been resolved, all of the modifications will be applied to the design together, the design will be saved, and the layout will become obsolete.

type ModifySolarPanelsCallback = (layout: ModifySolarPanelsLayout) => void | Promise<void>;

modifySolarPanels Layout Object

The layout is a snapshot representation of the current panels in the design. It contains all of the roof-based panels grouped by their roof face. Only roof faces that contain panels will be included.

After the callback resolves and the modifications are applied to the design, the layout will no longer be current, and the panel methods will no longer work. Because of this, the layout should never be stored between calls to this design method.

type ModifySolarPanelsLayout = {
roofFaces: {
panels: ModifySolarPanelsPanel[];
};
};

modifySolarPanels Panel Object

Each panel contains information about its size and position on the roof face. Panels can be marked for modification with their disable() enable() or remove() methods. Once the callback resolves, the panel’s methods can no longer be called and will throw an error.

parametertypedescription
roofFaceXnumber (meters) or nullThe x coordinate of the panel's center on the roof plane. It will be null if the panel is rotated or tilted.
roofFaceYnumber (meters) or nullThe y coordinate of the panel's center on the roof plane. It will be null if the panel is rotated or tilted.
heightnumber (meters)The vertical height of the panel on the roof plane
widthnumber (meters)The horizontal width of the panel on the roof plane
isEnabledbooleanWhether the panel is currently enabled.
enablefunctionA method called to mark a panel to be enabled after the callback resolves
disablefunctionA method called to mark a panel to be disabled after the callback resolves
removefunctionA method called to mark a panel to be removed after the callback resolves
type ModifySolarPanelsPanel = {
roofFaceX: number | null;
roofFaceY: number | null;
height: number;
width: number;
isEnabled: boolean;
enable: () => void;
disable: () => void;
remove: () => void;
};