Dictionary

Introduction

The dictionary menu contains components for working with eyas dictionary objects. Dictionaries are a unique feature to Eyas and provide the user with the means to create associative relationships between volatile grasshopper objects and to add user defined fields to the objects.

2015-06-02_100647
Dictionary Menu Components

Basics

A dictionary is a way to assign a unique key to any value. The value is any type of grasshopper object. This allows the user to create exact object associations when manipulating data. Once created a dictionary has a unique name on the canvas, this is either auto assigned or defined by the user. A dictionary maybe accessed at any place on the canvas using the library component. The name of the dictionary is given to the library and the dictionary will be retrieved. Dictionaries can be scoped local to the existing canvas document or from an external canvas document.

Creating

The create dictionary component is used to define a dictionary composed of user defined keys and values. The keys may be auto assigned by the component – the default is to use a key composed of an integer starting at a 1 key. The user may define their own key, if the option to allow non distinct is set to True, then the component will auto assign a suffix to the key of any non distinct values. If FALSE then any non distinct keys with associated values will not be added to the dictionary. A dictionary may be assigned a name by the user, this is hast to be a unique within the scope of the grasshopper document. If an existing name of a dictionary exists on the canvas then a an auto assigned suffix will be assigned to the name such that it is unique. The user may also add a description of what the dictionary is about. The user may also assign field names and associated filed values to the key/value pair of a dictionary.

Sorting

Once a dictionary has been created, a dictionary can be sorted by:

  • Key
  • Value

Viewing

Once created, the keys and values of a dictionary may be viewed at any point using the view components. The outputs of the components are the  a string representing the field names/values, keys and the grasshopper object of the value.

Display

The rhino GUI is used to graphically dispaly to the user the following:

  • Keys
  • Field Name
  • Field Value

Filtering

For a EyasDictionary obect, the user may filter a dictionary using the following options:

  • Key
  • Index
  • Value
  • FieldName
  • FieldValue

Wild card expressions may be used when filtering. When filtering by value. associative relationships may be defined from existing grasshopper objects. For instance, values may be points or curves. In this way, associative relationships between geometry and existing dictionary objects may be defined.

Modification

An existing dictionary by modified by:

  • Deleting key value pairs by a given key
  • Replace existing key with a new key
  • Replace existing key/value with a new value
  • Replace existing key/value with a new key/value
  • Insert new key/value pairs into an existing dictionary

Library

A dictionary once created may be accessed at any point from the canvas by using the library component. The user may select a dictionary using wild cards based on the name of the dictionary/s and/or description of the dictionary. The library may in addition access dictionaries either locally from the existing canvas document or forma another  external canvas document.

Leave a Reply

Your email address will not be published. Required fields are marked *