Class: Sketchup::RenderingOptions

Inherits:
Entity
  • Object
show all
Includes:
Enumerable

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 #

Sketchup::RenderingOptions::ROPAssign
Sketchup::RenderingOptions::ROPDrawHidden
Sketchup::RenderingOptions::ROPDrawHiddenGeometry
Sketchup::RenderingOptions::ROPDrawHiddenObjects
Sketchup::RenderingOptions::ROPEditComponent
Sketchup::RenderingOptions::ROPSectionDisplayTurnedOff
Sketchup::RenderingOptions::ROPSetBackgroundColor
Sketchup::RenderingOptions::ROPSetConstructionColor
Sketchup::RenderingOptions::ROPSetDepthQueEdges
Sketchup::RenderingOptions::ROPSetDepthQueWidth
Sketchup::RenderingOptions::ROPSetDisplayColorByLayer
Sketchup::RenderingOptions::ROPSetDisplayDims
Sketchup::RenderingOptions::ROPSetDisplayFog
Sketchup::RenderingOptions::ROPSetDisplayInstanceAxes
Sketchup::RenderingOptions::ROPSetDisplaySketchAxes
Sketchup::RenderingOptions::ROPSetDisplayText
Sketchup::RenderingOptions::ROPSetDisplayWatermarks
Sketchup::RenderingOptions::ROPSetDrawBackEdges
Sketchup::RenderingOptions::ROPSetDrawGround
Sketchup::RenderingOptions::ROPSetDrawHorizon
Sketchup::RenderingOptions::ROPSetDrawUnderground
Sketchup::RenderingOptions::ROPSetEdgeColorMode
Sketchup::RenderingOptions::ROPSetEdgeDisplayMode
Sketchup::RenderingOptions::ROPSetEdgeType
Sketchup::RenderingOptions::ROPSetExtendEdges
Sketchup::RenderingOptions::ROPSetExtendLines
Sketchup::RenderingOptions::ROPSetFaceColor
Sketchup::RenderingOptions::ROPSetFogColor
Sketchup::RenderingOptions::ROPSetFogDist
Sketchup::RenderingOptions::ROPSetFogHint
Sketchup::RenderingOptions::ROPSetFogUseBkColor
Sketchup::RenderingOptions::ROPSetForegroundColor
Sketchup::RenderingOptions::ROPSetGroundColor
Sketchup::RenderingOptions::ROPSetGroundTransparency
Sketchup::RenderingOptions::ROPSetHorizonColor
Sketchup::RenderingOptions::ROPSetHideConstructionGeometry
Sketchup::RenderingOptions::ROPSetHighlightColor
Sketchup::RenderingOptions::ROPSetJitterEdges
Sketchup::RenderingOptions::ROPSetLineEndEdges
Sketchup::RenderingOptions::ROPSetLineEndWidth
Sketchup::RenderingOptions::ROPSetLineExtension
Sketchup::RenderingOptions::ROPSetLineStyleEdges
Sketchup::RenderingOptions::ROPSetLockedColor
Sketchup::RenderingOptions::ROPSetMaterialTransparency
Sketchup::RenderingOptions::ROPSetModelTransparency
Sketchup::RenderingOptions::ROPSetPhotomatchBackgroundOpacity
Sketchup::RenderingOptions::ROPSetPhotomatchDrawBackground
Sketchup::RenderingOptions::ROPSetPhotomatchDrawOverlay
Sketchup::RenderingOptions::ROPSetPhotomatchOverlayOpacity
Sketchup::RenderingOptions::ROPSetProfileEdges
Sketchup::RenderingOptions::ROPSetProfilesOnlyEdges
Sketchup::RenderingOptions::ROPSetProfileWidth
Sketchup::RenderingOptions::ROPSetRenderMode
Sketchup::RenderingOptions::ROPSetSectionActiveColor
Sketchup::RenderingOptions::ROPSetSectionCutFilled
Sketchup::RenderingOptions::ROPSetSectionCutWidth
Sketchup::RenderingOptions::ROPSetSectionDefaultCutColor
Sketchup::RenderingOptions::ROPSetSectionDefaultFillColor
Sketchup::RenderingOptions::ROPSetSectionDisplayMode
Sketchup::RenderingOptions::ROPSetSectionInactiveColor
Sketchup::RenderingOptions::ROPSetSkyColor
Sketchup::RenderingOptions::ROPSetTexture
Sketchup::RenderingOptions::ROPSetTransparencyObsolete
Sketchup::RenderingOptions::ROPSetXRayOpacity
Sketchup::RenderingOptions::ROPTransparencySortMethod
Sketchup::RenderingOptions::ROPSetAOEnabled
Sketchup::RenderingOptions::ROPSetAODistance
Sketchup::RenderingOptions::ROPSetAOIntensity
Sketchup::RenderingOptions::ROPSetFaceColorMode

Class Method Summary # collapse

Instance Method Summary # collapse

Methods inherited from Entity

#attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #set_attribute, #to_s, #typename, #valid?

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:

Returns:

  • (nil)

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.

Returns:

  • (Object, nil)

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

Returns:

  • (Integer)

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:

Returns:

  • (nil)

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:

Returns:

  • (nil)

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}"
}

Returns:

  • (nil)

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

Returns:

  • (Integer)

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

Returns:

  • (Integer)

See Also:

Version:

  • SketchUp 2014