SketchUp 8 Collections

This is a machine generated list of the collection objects defined by SketchUp classes. The links in this document are machine generated, so some may not exist.

Generated with SUMD_Collections v2.0, on 2015-12-21 at 04:27:22 PM GMT, using SketchUp v8.0.16846 & Ruby v1.8.6.

The criteria is that a class has .each defined as a public method. Note that .each is an Array method and is not a method of Enumerable.

The classes can be divided into two groups:

  • 'Live' read-only collections of objects, with factory methods to add new members. All include Enumerable, and all suport indexed retrieval, although order/position may vary from call to call.

  • 'Hash' like collections where items cannot be added or removed. An example would be RenderingOptions.

Typically 'Live' collections have a .length property that is more of a method or a numeric object (as opposed to a value). The following code shows a change in the length of entities as the two faces are added.

am_ents = Sketchup.active_model.entities
s = 300
f1 = [ 0, 0, 0 ] , [ 0, s, 0 ] , [ s, s, 0 ] , [ s, 0, 0 ]
f2 = [ 0, 0, s ] , [ 0, s, s ] , [ s, s, s ] , [ s, 0, s ]

puts "am_ents.length = #{am_ents.length}"
am_ents.add_face( f1 )
puts "am_ents.length = #{am_ents.length}"
am_ents.add_face( f2 )
puts "am_ents.length = #{am_ents.length}"

What this means is that it will often be faster to make a copy of the collection using .to_a if you are looping thru the whole collection. .grep() will do the same thing if you only need a subset. You may find .to_a.grep() to be faster.

Sketchup::AttributeDictionariesYesYY Sketchup::Entity
Sketchup::DefinitionListYesYY Sketchup::Entity
Sketchup::EntitiesYesYY Object
Sketchup::ExtensionsManagerYesYY Object
Sketchup::LayersYesYY Sketchup::Entity
Sketchup::MaterialsYesYY Sketchup::Entity
Sketchup::OptionsManagerYesYY Object
Sketchup::PagesYesYY Sketchup::Entity
Sketchup::SelectionYesYY Object
Sketchup::StylesYesYY Sketchup::Entity
Set Yes Object
UI::ToolbarYesY Object