To create a new dictionary, you need to create an instance of AcDbDictionary, add it to the database, and register it with its owner object. Use the setAt() function to add objects to the dictionary and the database.
The setAt() function adds a new entry specified by newValue to the dictionary. If the entry already exists, it is replaced by the new value. The name of the object is specified by srchKey. The object ID of the entry is returned in retObjId.
When you add an entry to a dictionary, the dictionary automatically attaches a reactor to the entry. If the object is erased, the dictionary is notified and removes it from the dictionary.