Irradiance and Performance Sim
Below is a more complex example that loads a design, runs irradiance simulation, displays it, then runs a performance simulation.
Try it for yourself by replacing <script_url>
with the URL of the Aurora Client SDK, <access_token>
with your access token, and <design_id>
with the ID of a design in your tenant.
const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
await sdk.cad.attach('#cad-element');
let design = await window.sdk.design.load('<design_id>');
// Run irradiance and turn on for the roof and panels
await window.design.runIrradiance();
await window.design.toggleView({
irradianceMapPanels: true,
irradianceMap: true,
});
// Run performance simulation and retrieve energy production
// Be patient, this can take between 10-30 seconds
const results = await window.design.runPerformanceSimulation();
console.log(results);
await window.design.toggleView({
lidar: true,
});