Class: Sketchup::AttributeDictionaries
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.
Instance Method Summary # collapse
-
#[](key) ⇒ Sketchup::AttributeDictionary
Get an AttributeDictionary by name.
-
#count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
-
#delete(key_or_dict) ⇒ Sketchup::AttributeDictionaries
The delete method destroys a given AttributeDictionary.
-
#each {|dictionary| ... } ⇒ Object
The #each method is used to iterate through all of the attributes dictionaries.
-
#length ⇒ Integer
The #length method returns the number of attribute dictionary objects in the collection.
- #size ⇒ Integer
Methods inherited from Entity
#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?
Instance Method Details
↑ #[](key) ⇒ Sketchup::AttributeDictionary
Get an AttributeDictionary by name. Returns nil if there is none with the given name.
↑ #count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
↑ #delete(key_or_dict) ⇒ Sketchup::AttributeDictionaries
The delete method destroys a given AttributeDictionary. This AttributeDictionary can be passed directly or identified by its string name.
In SketchUp 2018, special attribute dictionaries have been added. The name of these dictionaries are “SU_InstanceSet” and “SU_DefinitionSet”. The dictionaries cannot be deleted via ruby and an ArgumentError will be raised. The key/value pairs in the dictionary can be deleted safely.
object
↑ #each {|dictionary| ... } ⇒ Object
The #each method is used to iterate through all of the attributes dictionaries.