ShadowInfo

class ShadowInfo

Parent: Entity | Class Index
Methods:each_key, keys, [], []=, each, each_key, each_pair, keys |
Sample Code:shadowinfotests.rb |

The ShadowInfo class contains method to extract the shadow information for a model. The majority of the shadow information returned exists in the Model Info > Location and Model Info > Shadows section of SketchUp. The following shadow information keys are maintained in SketchUp:

Key | Location in SketchUp | Comments
City | Model Info > Location | City is referred to as Location in Sketchup
Country | Model Info > Location |
Dark | Model Info > Shadows |
DaylightSavings |  |
DisplayNorth | Model Info > Location > Show In Model checkbox |
DisplayOnAllFaces | Model Info > Shadows |
DisplayOnGroundPlane | Model Info > Shadows |
DisplayShadows | Model Info > Shadows |
EdgeCastingShadows | Model Info > Shadows |
Latitude | Model Info > Location > Set Custom Location |
Light | Model Info > Shadows |
Longitude | Model Info > Location > Set Custom Location |
North Angle | Model Info > Location |
ShadowTime | Model Info > Shadows | In Time section
SunRise | N/A | Generated based on ShadowTime
SunSet | N/A | Generated based on ShadowTime

Class Methods

each_key
The each_key method is a class method that iterates through all of the shadow information keys.
Syntax:
Sketchup::ShadowInfo.each_key { | key | … }
Arguments:
key – variable to hold each key as they are found
Return Value:
Comments:
Example:
# Iterate through each key, displaying each in a message box Sketchup:ShadowInfo.each_key { | key | UI.messagebox key }

keys
The keys method is a class method that returns an array with all of the attribute keys
Syntax:
keys = Sketchup::ShadowInfo.keys
Arguments:
Return Value:
keys – an array of keys
Comments:
Example:
# Retrieve the first key key = Sketchup::ShadowInfo.keys[0] UI.messagebox key

Instance Methods

[]
Syntax:
Arguments:
Return Value:
Comments:
Example:

[]=
Syntax:
Arguments:
Return Value:
Comments:
Example:

each
The each method iterates through all of the shadow information key/value pairs.
Syntax:
shadowinfo.each { | key, value | … }
Arguments:
key, value – variables that will hold each key and value as they are found.
Return Value:
Comments:
Example:
model = Sketchup.active_model shadowinfo = model.shadow_info # Iterate through each key and value displaying each in a message box shadowinfo.each { | key, value | UI.messagebox key } shadowinfo.each { | key, value | UI.messagebox value }

each_key
The each_key method iterates through all of the shadow information keys.
Syntax:
shadowinfo.each_key { | key | … }
Arguments:
key – variable to hold each key as they are found
Return Value:
Comments:
Example:
model = Sketchup.each_key shadowinfo = model.shadow_info # Iterate through each key, displaying each in a message box shadowinfo.each_key { | key | UI.messagebox key }

each_pair
An alias for each. See ShadowInfo.each
Syntax:
Arguments:
Return Value:
Comments:
Example:

keys
The keys method returns an array with all of the attribute keys
Syntax:
keys = shadowinfo.keys
Arguments:
Return Value:
keys – an array of keys
Comments:
Example:
model = Sketchup.active_model shadowinfo = model.shadow_info keys = shadowinfo.keys key = keys[0] UI.messagebox key