class AttributeDictionaries |
Parent: Object |
|
| |
Sample Code: attrdicttests.rb |
|
Instance Methods |
[] |
The [] method is used to retrieve the AttributeDictonary object with a provided name. |
Syntax: |
attributedictionary = attributedictionaries["attributedictionaryname"] |
Arguments: |
“attributedictionaryname” – the name of an existing attribute dictionary |
Return Value: |
attributedictionary – an attribute dictionary object if successful, nil if unsuccessful |
Comments: |
This method also throws an exception when a dictionary of the provided name is not found. |
Example: |
model
= Sketchup.active_model begin if (attrdict) |
delete |
The delete method is used to delete an attribute dictionary. |
Syntax: |
status = attrributedictionaries(attributedictionary | “attributedictionaryname”) |
Arguments: |
attributedictionary or “attributedictionaryname” – an attribute dictionary object or the name of an attribute dictionary to delete |
Return Value: |
status – a reference to an attribute dictionary if successful |
Comments: |
Throws an exception if unsuccessful or returns nil. |
Example: |
model = Sketchup.active_model begin if (status) |
each |
The each method is used to iterate through all of the AttributeDictionary objects in the AttributeDictionaries object. |
Syntax: |
attributedictionaries.each { | attributedictionary | … } |
Arguments: |
attributedictionary – a variable that will hold each attribute dictionary object as they are found if successful |
Return Value: |
|
Comments: |
Throws an exception if there are no attribute dictionaries. |
Example: |
dictionaries = model.attribute_dictionaries # iterates through all attribute dictionaries
and prints the size (number of attributes) to the screen |