My favorites | English | Sign in

Faster apps faster - GWT 2.0 with Speed Tracer New!

Google SketchUp Ruby API

ShadowInfo

class

Parent: Entity

Introduction

SketchUp 6.0+

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 dialogs inside SketchUp.

The following shadow information keys are maintained in SketchUp:

  • City (in Model Info > Location -- City is called "Location" in the UI)
  • Country (in Model Info > Location)
  • Dark (in Model Info > Shadows)
  • DaylightSavings
  • DisplayNorth (in Model Info > Location > Show In Model checkbox)
  • DisplayOnAllFaces (in Model Info > Shadows)
  • DisplayOnGroundPlane (in Model Info > Shadows)
  • DisplayShadows (in Model Info > Shadows)
  • EdgeCastingShadows (in Model Info > Shadows)
  • Latitude (in Model Info > Location > Set Custom Location)
  • Light (in Model Info > Shadows)
  • Longitude (in Model Info > Location > Set Custom Location)
  • North Angle (in Model Info > Location)
  • ShadowTime (in Model Info > Shadows -- In Time section)
  • SunRise (Generated based on ShadowTime)
  • SunSet (Generated based on ShadowTime)


You access the ShadowInfo object by calling Model.shadow_info:

     model = Sketchup.active_model
     shadowinfo = model.shadow_info
     UI.messagebox("My city is: " + shadowinfo["City"].to_s)

Methods

ShadowInfo.[]SketchUp 6.0+

The [] method retrieves a value from the array of keys

Arguments:

key
The key of the shadowinfo value to retrieve.

Returns:

value
the value that is retrieved.
 value = shadowinfo["key"]

ShadowInfo.[]=SketchUp 6.0+

The set value []= method is used to set the value in the array of shadow info options.

Arguments:

key
The key of the shadowinfo value to set.
value
The value to be set.

Returns:

value
the value that was set if successful, or false if unsuccessful.
 model = Sketchup.active_model
 shadowinfo = model.shadow_info
 value = shadowinfo["City"]
 UI.messagebox value
 value = shadowinfo["City"]="Denver, CO"
 UI.messagebox value

ShadowInfo.add_observerSketchUp 6.0+

The add_observer method is used to add an observer to the current object.

Arguments:

observer
An observer.

Returns:

true if successful, false if unsuccessful.
 status = object.add_observer observer

ShadowInfo.eachSketchUp 6.0+

The each method iterates through all of the shadow information key/value pairs.

Arguments:

key
A variables that will hold each key as it is found.
value
A variables that will hold each value as it is found.

Returns:

nil
 model = Sketchup.active_model
 shadowinfo = model.shadow_info
 shadowinfo.each { |key, value|
   UI.messagebox(key.to_s + '=' + value.to_s)
 }

ShadowInfo.each_keySketchUp 6.0+

The each_key method iterates through all of the shadow information keys.

Arguments:

key
Variable to hold each key as they are found.

Returns:

nil
 shadowinfo.each_key { |key| UI.messagebox(key) }

ShadowInfo.each_pairSketchUp 6.0+

An alias for each. See ShadowInfo.each.

Returns:

nil
 model = Sketchup.active_model
 shadowinfo = model.shadow_info
 shadowinfo.each_pair { |key, value|
   UI.messagebox(key.to_s + '=' + value.to_s)
 }

ShadowInfo.keysSketchUp 6.0+

The keys method is a class method that returns an array with all of the attribute keys

Returns:

keys
an array of keys
 keys = Sketchup::ShadowInfo.keys

ShadowInfo.remove_observerSketchUp 6.0+

The remove_observer method is used to remove an observer from the current object.

Arguments:

observer
An observer.

Returns:

true if successful, false if unsuccessful.
 status = object.remove_observer observer