My favorites | English | Sign in

Google SketchUp Ruby API

RenderingOptions

class

Parent: Object

Introduction

SketchUp 6.0+

The RenderingOptions class contains method to extract the rendering information for a model. The majority of the rendering information returned exists in the Model Info > Display section of SketchUp. The following rendering information keys are maintained in SketchUp:

  • BackgroundColor
  • BandColor
  • ConstructionColor
  • DisplayColorbyLayer
  • DisplayFog
  • DisplayFogEdges
  • DisplayInstanceAxes
  • DrawGround
  • DrawHidden
  • DrawHorizon
  • DrawSilhouettes
  • EdgeColorMode
  • EdgeDisplayMode
  • ExtendLines
  • FaceBackColor (in Model Info > Colors)
  • FaceColorMode
  • FaceFrontColor (in Model Info > Colors)
  • FogColor
  • FogDensity
  • FogEnd
  • FogStart
  • FogType
  • FogUseBkColor
  • ForegroundColor
  • GroundColor (in Model Info > Colors)
  • GroundTransparency (in Model Info > Colors)
  • HighlightColor
  • HorizonColor
  • InactiveHidden
  • InstanceHidden
  • JitterEdges (in Model Info > Display)
  • LineExtension (in Model Info > Display)
  • MaterialTransparency (in Materials Browser)
  • ModelTransparency
  • RenderMode
  • SectionActiveColor (in Model Info > Sections)
  • SectionCutWidth (in Model Info > Sections)
  • SectionDefaultCutColor (in Model Info > Sections)
  • SectionInactiveColor (in Model Info > Sections)
  • SilhouetteWidth
  • SkyColor (in Model Info > Colors)
  • Texture (in Materials Browser)
  • TransparencySort

Methods

RenderingOptions.[]SketchUp 6.0+

The set value [] method is used to get the value in the array of rendering options.

Arguments:

key
The key of the rendering option value to set.

Returns:

value
the value that was found.
 model = Sketchup.active_model
 renderingoptions = model.rendering_options
 value = renderingoptions["DisplayInstanceAxes"]
 UI.messagebox value

RenderingOptions.[]=SketchUp 6.0+

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

Arguments:

key
The key of the rendering option 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
 renderingoptions = model.rendering_options
 value = renderingoptions["DisplayInstanceAxes"]
 UI.messagebox value
 value = renderingoptions["DisplayInstanceAxes"] = true
 UI.messagebox value

RenderingOptions.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

RenderingOptions.eachSketchUp 6.0+

The each method iterates through all of the rendering options key/value pairs.

Arguments:

key
The key of each pair found.
value
The value of each pair found.

Returns:

nil
 model = Sketchup.active_modelrenderingoptions = model.rendering_options
 renderingoptions.each { | key, value | UI.messagebox key }
 renderingoptions.each { | key, value | UI.messagebox value }

RenderingOptions.each_keySketchUp 6.0+

The each_key method iterates through all of the rendering options keys.

Arguments:

key
Variable to hold each key as they are found.

Returns:

nil
 renderingoptions.each_key { | key |
   UI.messagebox key
 }

RenderingOptions.each_pairSketchUp 6.0+

An alias for each. See RenderingOptions.each.

Returns:

nil
 # Need example ruby code here.

RenderingOptions.keysSketchUp 6.0+

The keys method returns an array with all of the attribute keys.

Returns:

keys
an array of keys
 model = Sketchup.active_model
 renderingoptions = model.rendering_options
 keys = renderingoptions.keys
 key = keys[0]
 UI.messagebox key

RenderingOptions.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