Controls
Controls for interacting with the cad window or elements which can be displayed or hidden, such as irradiance or lidar.
All controls are asynchronous and return a promise.
Use await
or .then
to handle the resolved value and ensure proper execution order.
toggleFullScreen
Allows toggling between full screen and windows view
Usage
const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
sdk.cad.toggleFullScreen();
Signature
toggleFullScreen();
Returns
Promise<void>
getViewToggle
Retrieve the current visibility state of the controllable elements within the CAD screen
Usage
const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);
const currentViewToggles = await design.getViewToggle();
Signature
getViewToggle();
Returns
A promise that resolves with the current view toggles as described in options-section: #options.
toggleView
Control visibility of elements within the CAD screen, such as trees or lidar
Usage
const library = await import('<script_url>');
const sdk = await library.load({ token: '<access_token>' });
const design = await sdk.design.load(designId);
await design.toggleView({
trees: true,
lidar: false,
irradianceMap: true,
});
Note that toggling irradianceMapPanels
from on to off will automatically run the roof and panel irradiance analysis if the data is stale. See the section on the runIrradiance method for context.
Signature
toggleView([options]);
Parameters
parameter | type | note |
---|---|---|
options (required) | object | Detailed in Options below. |
Returns
A promise that resolves when all of the provided elements have finished appearing or disappearing.
Options
All options are boolean values.
A value of true
will show the view, and false
will hide it.
Key | Description | |
---|---|---|
azimuthArrows | Show/hide azimuth arrow visibility | |
buildings | Show/hide 3D building models | |
connections | Show/hide connections between components. | |
designComponents | Show/hide design components | |
disabledPanels | Show/hide disabled panels | |
edges | Show/hide highlight of roof edges | |
electricalComponents | Show/hide electrical components | |
fillZones | Show/hide fill zones | |
ground | Show/hide the ground. | |
irradianceMap | Show/hide irradiance map texture on the roof model | |
irradianceMapPanels | Show/hide irradiance map texture on the solar panels | |
lidar | Show/hide LIDAR shading map | |
mapImagery | Show/hide map texture on the ground | |
measurements | Show/hide labels for roof measurements | |
projectCenter | Show/hide the project center icon | |
setbacks | Show/hide setbacks | |
shadows | Show/hide shadows on building models (ground shadows will remain visible regardless) | |
sky | Show/hide sky texture | |
solarPanels | Show/hide solar panels | |
strings | Show/hide strings | |
sunpath | Show/hide sun path (non-animated) | |
trees | Show/hide tree models | |
walkways | Show/hide walkways |