123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::RenderingOptions

Relationships
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Entity
Instance Chain:
self, Enumerable, Entity
Inherits: Sketchup::Entity

Overview

The RenderingOptions class contains method to extract the rendering information for a model. The majority of the rendering information returned exists in the Styles dialog. The following rendering information keys are maintained in SketchUp:

  • BackgroundColor

  • BandColor

  • ConstructionColor

  • DepthQueWidth

  • DisplayColorByLayer

  • DisplayFog

  • DisplayInstanceAxes

  • DisplayWatermarks

  • DrawDepthQue

  • DrawGround

  • DrawHidden

  • DrawHorizon

  • DrawLineEnds

  • DrawProfilesOnly

  • DrawSilhouettes

  • DrawUnderground

  • EdgeColorMode

  • EdgeDisplayMode

  • EdgeType

  • ExtendLines

  • FaceBackColor

  • FaceFrontColor

  • FogColor

  • FogEndDist

  • FogStartDist

  • FogUseBkColor

  • ForegroundColor

  • GroundColor

  • GroundTransparency

  • HideConstructionGeometry

  • HighlightColor

  • HorizonColor

  • InactiveHidden

  • InstanceHidden

  • JitterEdges

  • LineEndWidth

  • LineExtension

  • LockedColor

  • MaterialTransparency

  • ModelTransparency

  • RenderMode

  • SectionActiveColor

  • SectionCutWidth

  • SectionDefaultCutColor

  • SectionInactiveColor

  • ShowViewName

  • SilhouetteWidth

  • SkyColor

  • Texture

  • TransparencySort SketchUp 2017 treats Medium transparency as Faster.

Added in SketchUp 7:

  • DisplayDims

  • DisplaySketchAxes

  • DisplayText

Added in SketchUp 8:

  • InactiveFade

  • InstanceFade

Added in SketchUp 2014:

  • DisplaySectionPlanes

Added in SketchUp 2015:

  • DisplaySectionCuts

  • DrawBackEdges

  • SectionCutDrawEdges

Added in SketchUp 2018:

  • SectionCutFilled

  • SectionDefaultFillColor

Removed in SketchUp 2019.1

  • FaceColorMode This option was previously included but it was ineffective.

Added in SketchUp 2020.0:

  • ROPDrawHiddenGeometry

  • ROPDrawHiddenObjects

Added in SketchUp 2024.0:

  • AmbientOcclusion

  • AmbientOcclusionDistance

  • AmbientOcclusionIntensity

Version:

  • SketchUp 6.0

Constant Summary

Class Method Summary

Instance Attribute Summary

Entity - Inherited

#deleted?

The deleted? method is used to determine if your entity is still valid (not deleted by another script, for example.).

#valid?

The #valid? method is used to determine if your entity is still valid (not deleted by another script, for example).

Instance Method Summary

Entity - Inherited

#add_observer

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

#attribute_dictionaries

The attribute_dictionaries method is used to retrieve the AttributeDictionaries collection attached to the entity.

#attribute_dictionary

The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an Entity.

#delete_attribute

The #delete_attribute method is used to delete an attribute from an entity.

#entityID

The entityID method is used to retrieve a unique ID assigned to an entity.

#get_attribute

The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.

#inspect

The #inspect method is used to retrieve the string representation of the entity.

#model

The model method is used to retrieve the model for the entity.

#parent

The parent method is used to retrieve the parent of the entity.

#persistent_id

The #persistent_id method is used to retrieve a unique persistent id assigned to an entity.

#remove_observer

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

#set_attribute

The set attribute is used to set the value of an attribute in an attribute dictionary with the given name.

#to_s

The #to_s method is used to retrieve the string representation of the entity.

#typename

The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”.

Class Method Details

.each_key {|key| ... } ⇒ nil

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

Examples:

Sketchup.active_model.rendering_options.each_key { |key|
  puts key
}

Yield Parameters:

Version:

  • SketchUp 6.0

.keysArray<String>

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

Examples:

keys = Sketchup.active_model.rendering_options.keys

Returns:

Version:

  • SketchUp 6.0

Instance Method Details

#[](key) ⇒ Object?

The #[] method is used to get the value of a rendering option.

Examples:

result = Sketchup.active_model.rendering_options["DisplayInstanceAxes"]

Parameters:

  • key (String)

    The key of the rendering option value to get.

Version:

  • SketchUp 6.0

#[]=(key, value) ⇒ Object

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

Examples:

Sketchup.active_model.rendering_options["DisplayInstanceAxes"] = false

Parameters:

  • key (String)

    The key of the rendering option value to set.

  • value (Object)

    The value to be set.

Returns:

  • (Object)

    the value that was set

Raises:

  • (ArgumentError)

    If the given key is invalid, the key’s value is not settable, or the given value is invalid. SketchUp versions earlier than 2024.0 will not raise this error.

Version:

  • SketchUp 6.0

#add_observer(observer) ⇒ Boolean

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

Examples:

observer = Sketchup::RenderingOptionsObserver.new # Dummy observer.
result = Sketchup.active_model.rendering_options.add_observer(observer)

Parameters:

  • observer (Object)

    An observer.

Returns:

  • (Boolean)

    true if successful, false if unsuccessful.

Version:

  • SketchUp 6.0

#countInteger

The #count method is inherited from the Enumerable mix-in module.

Examples:

options = Sketchup.active_model.rendering_options
number = options.count

Version:

  • SketchUp 2014

#each {|key, value| ... } ⇒ nil

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

Examples:

Sketchup.active_model.rendering_options.each { |key, value|
  puts "#{key} : #{value}"
}

Yield Parameters:

See Also:

Version:

  • SketchUp 6.0

#each_key {|key| ... } ⇒ nil

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

Examples:

Sketchup.active_model.rendering_options.each_key { |key|
  puts key
}

Yield Parameters:

Version:

  • SketchUp 6.0

#each_pairnil

The #each_pair method is an alias for #each.

Examples:

Sketchup.active_model.rendering_options.each_pair { |key, value|
  puts "#{key} : #{value}"
}

See Also:

Version:

  • SketchUp 6.0

#keysArray<String>

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

Returns:

Version:

  • SketchUp 6.0

#lengthInteger

The #length method returns the number of options in the rendering options collection.

Examples:

options = Sketchup.active_model.rendering_options
number = options.length

See Also:

Version:

  • SketchUp 2014

#remove_observer(observer) ⇒ Boolean

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

Examples:

observer = Sketchup::RenderingOptionsObserver.new # Dummy observer.
options = Sketchup.active_model.rendering_options
options.add_observer(observer)
result = options.remove_observer(observer)

Parameters:

  • observer (Object)

    An observer.

Returns:

  • (Boolean)

    true if successful, false if unsuccessful.

Version:

  • SketchUp 6.0

#sizeInteger

The #size method is an alias for #length.

Examples:

options = Sketchup.active_model.rendering_options
number = options.size

See Also:

Version:

  • SketchUp 2014