Class: Sketchup::AttributeDictionaries
- Includes:
- Enumerable
- Defined in:
- lib/attributedictionaries.rb
Overview
The AttributeDictionaries class is a collection of all of the AttributeDictionary objects that are attached to a given Entity object.
The Entity class is a popular parent class in SketchUp, meaning you can attach AttributeDictionaries to almost anything, from geometric items like edges and faces and components to more conceptual things like pages or materials.
You access this class not by performing an AttributeDictionaries.new but by grabbing a handle from an existing entity.
By default, when entity is created it has no AttributeDictionaries object: g = Sketchup.active_model.entities.add_group g.attribute_dictionaries # => nil The AttributeDictionaries object is added to the entity only once the first attribute is added to the entity: g.set_attribute("Test", "Yo", "Hello") g.attribute_dictionaries # => #Sketchup::Group:0x00000007569bc0> When iterating through entity attribute dictionaries, be sure to verify that Sketchup::Entity.#attribute_dictionaries is not nil.
Instance Method Summary collapse
-
#[](key) ⇒ AttributeDictionary
Get an AttributeDictionary object by name.
-
#delete(key_or_dict) ⇒ AttributeDictionaries
Destroy AttributeDictionary object.
-
#each {|dictionary| ... } ⇒ nil
Iterate through all of the attribute dictionaries.
-
#length ⇒ Fixnum
(also: #size)
Get the number of AttributeDictionary objects in the collection.
Methods inherited from Entity
#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #model, #parent, #remove_observer, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
#[](key) ⇒ AttributeDictionary
Get an Sketchup::AttributeDictionary object by name.
55 56 |
# File 'lib/attributedictionaries.rb', line 55 def [](key) end |
#delete(key_or_dict) ⇒ AttributeDictionaries
Destroy Sketchup::AttributeDictionary object.
70 71 |
# File 'lib/attributedictionaries.rb', line 70 def delete(key_or_dict) end |
#each {|dictionary| ... } ⇒ nil
Iterate through all of the attribute dictionaries.
85 86 |
# File 'lib/attributedictionaries.rb', line 85 def each end |
#length ⇒ Fixnum Also known as: size
Get the number of Sketchup::AttributeDictionary objects in the collection.
99 100 |
# File 'lib/attributedictionaries.rb', line 99 def length end |