Skip to content

ShadowInfo

A snapshot of SketchUp’s shadow and sun settings.

Retrieve it with model.getShadowInfo(). It captures the geographic location, sun angle, time of day, and display toggles that control how shadows render.

let model = await SketchUpApi.getActiveModel();
let shadows = await model.getShadowInfo();
console.log(shadows.city);
// => 'Boulder (CO)'
console.log(shadows.latitude);
// => 40.0
console.log(shadows.displayShadows);
// => true or false

Model.getShadowInfo

readonly city: string

The location name used for sun angle calculations, like 'Boulder (CO)'. Labeled “Location” in the SketchUp UI.


readonly country: string

The country name associated with the model location, like 'USA'.


readonly dark: number

Shadow darkness as a value from 0 (transparent) to 100 (fully dark), like 45. Corresponds to the Dark slider in Window > Shadows.


readonly daylightSavings: boolean

Whether daylight saving time is in effect for the shadow time calculation.


readonly dayOfYear: number

Day of the year (1–365) used to compute the sun angle, like 312.


readonly displayNorth: boolean

Whether the north direction indicator is shown in the viewport.


readonly displayOnAllFaces: boolean

Whether shadows are cast onto faces.


readonly displayOnGroundPlane: boolean

Whether shadows are cast onto the ground plane.


readonly displayShadows: boolean

Whether shadows appear at all.


readonly edgesCastShadows: boolean

Whether edges cast shadows.


readonly latitude: number

Geographic latitude in decimal degrees, like 40.018. Positive is north.


readonly light: number

Ambient light level from 0 (dark) to 100 (fully lit), like 80. Corresponds to the Light slider in Window > Shadows.


readonly longitude: number

Geographic longitude in decimal degrees, like -105.24. Positive is east.


readonly northAngle: number

The angle of north relative to the model axes, in degrees, like 0.


readonly shadowTime: string

The current shadow time as a date-time string, like '2013-11-08 13:30.000000 +0000'.


readonly shadowTime_time_t: number

Shadow time as Unix epoch seconds, like 1383917400.


readonly sunDirection: Vector3d

The computed direction of the sun as a 3D vector.


readonly sunRise: string

Computed sunrise time as a date-time string, like '2013-11-08 06:43.000000 +0000'.


readonly sunRise_time_t: number

Sunrise time as Unix epoch seconds, like 1383892994.


readonly sunSet: string

Computed sunset time as a date-time string, like '2013-11-08 16:45.000000 +0000'.


readonly sunSet_time_t: number

Sunset time as Unix epoch seconds, like 1383929157.


readonly tZOffset: number

UTC timezone offset in hours, like -7 for Mountain Time.


readonly useSunForAllShading: boolean

Whether the sun direction is used for all shading, including faces that would otherwise be in shadow.

refresh(): Promise<ShadowInfo>

Re-fetches the shadow info from SketchUp to pick up any changes made since this snapshot was taken.

Promise<ShadowInfo>


toString(): string

string