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.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let shadows = await model.getShadowInfo();
console.log(shadows.city);// => 'Boulder (CO)'console.log(shadows.latitude);// => 40.0console.log(shadows.displayShadows);// => true or falseProperties
Section titled “Properties”
readonlycity:string
The location name used for sun angle calculations, like
'Boulder (CO)'. Labeled “Location” in the SketchUp UI.
country
Section titled “country”
readonlycountry:string
The country name associated with the model location, like
'USA'.
readonlydark:number
Shadow darkness as a value from 0 (transparent) to 100
(fully dark), like 45. Corresponds to the Dark slider in
Window > Shadows.
daylightSavings
Section titled “daylightSavings”
readonlydaylightSavings:boolean
Whether daylight saving time is in effect for the shadow time calculation.
dayOfYear
Section titled “dayOfYear”
readonlydayOfYear:number
Day of the year (1–365) used to compute the sun angle,
like 312.
displayNorth
Section titled “displayNorth”
readonlydisplayNorth:boolean
Whether the north direction indicator is shown in the viewport.
displayOnAllFaces
Section titled “displayOnAllFaces”
readonlydisplayOnAllFaces:boolean
Whether shadows are cast onto faces.
displayOnGroundPlane
Section titled “displayOnGroundPlane”
readonlydisplayOnGroundPlane:boolean
Whether shadows are cast onto the ground plane.
displayShadows
Section titled “displayShadows”
readonlydisplayShadows:boolean
Whether shadows appear at all.
edgesCastShadows
Section titled “edgesCastShadows”
readonlyedgesCastShadows:boolean
Whether edges cast shadows.
latitude
Section titled “latitude”
readonlylatitude:number
Geographic latitude in decimal degrees, like 40.018.
Positive is north.
readonlylight:number
Ambient light level from 0 (dark) to 100 (fully lit), like
80. Corresponds to the Light slider in Window > Shadows.
longitude
Section titled “longitude”
readonlylongitude:number
Geographic longitude in decimal degrees, like -105.24.
Positive is east.
northAngle
Section titled “northAngle”
readonlynorthAngle:number
The angle of north relative to the model axes, in degrees,
like 0.
shadowTime
Section titled “shadowTime”
readonlyshadowTime:string
The current shadow time as a date-time string, like
'2013-11-08 13:30.000000 +0000'.
shadowTime_time_t
Section titled “shadowTime_time_t”
readonlyshadowTime_time_t:number
Shadow time as Unix epoch seconds, like 1383917400.
sunDirection
Section titled “sunDirection”
readonlysunDirection:Vector3d
The computed direction of the sun as a 3D vector.
sunRise
Section titled “sunRise”
readonlysunRise:string
Computed sunrise time as a date-time string, like
'2013-11-08 06:43.000000 +0000'.
sunRise_time_t
Section titled “sunRise_time_t”
readonlysunRise_time_t:number
Sunrise time as Unix epoch seconds, like 1383892994.
sunSet
Section titled “sunSet”
readonlysunSet:string
Computed sunset time as a date-time string, like
'2013-11-08 16:45.000000 +0000'.
sunSet_time_t
Section titled “sunSet_time_t”
readonlysunSet_time_t:number
Sunset time as Unix epoch seconds, like 1383929157.
tZOffset
Section titled “tZOffset”
readonlytZOffset:number
UTC timezone offset in hours, like -7 for Mountain Time.
useSunForAllShading
Section titled “useSunForAllShading”
readonlyuseSunForAllShading:boolean
Whether the sun direction is used for all shading, including faces that would otherwise be in shadow.
Methods
Section titled “Methods”refresh()
Section titled “refresh()”refresh():
Promise<ShadowInfo>
Re-fetches the shadow info from SketchUp to pick up any changes made since this snapshot was taken.
Returns
Section titled “Returns”Promise<ShadowInfo>
toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string