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.
Object | Enum | #each | #[] | #[]= | #each_pair | Super |
---|---|---|---|---|---|---|
Sketchup::AttributeDictionaries | Yes | Y | Y | Sketchup::Entity | ||
Sketchup::AttributeDictionary | Yes | Y | Y | Y | Y | Sketchup::Entity |
Sketchup::DefinitionList | Yes | Y | Y | Sketchup::Entity | ||
Sketchup::Entities | Yes | Y | Y | Object | ||
Sketchup::ExtensionsManager | Yes | Y | Y | Object | ||
Sketchup::Layers | Yes | Y | Y | Sketchup::Entity | ||
Sketchup::Materials | Yes | Y | Y | Sketchup::Entity | ||
Sketchup::OptionsManager | Yes | Y | Y | Object | ||
Sketchup::OptionsProvider | Yes | Y | Y | Y | Y | Object |
Sketchup::Pages | Yes | Y | Y | Sketchup::Entity | ||
Sketchup::RenderingOptions | Yes | Y | Y | Y | Y | Sketchup::Entity |
Sketchup::Selection | Yes | Y | Y | Object | ||
Sketchup::ShadowInfo | Yes | Y | Y | Y | Y | Sketchup::Entity |
Sketchup::Styles | Yes | Y | Y | Sketchup::Entity | ||
Set | Yes | Object | ||||
UI::Toolbar | Yes | Y | Object |