dictadd

AutoCad AutoLISP Functions

 
dictadd
 
 
 

Adds a nongraphical object to the specified dictionary

(dictadd ename symbol newobj)

Arguments

ename

Name of the dictionary the object is being added to.

symbol

The key name of the object being added to the dictionary; symbol must be a unique name that does not already exist in the dictionary.

newobj

A nongraphical object to be added to the dictionary.

As a general rule, each object added to a dictionary must be unique to that dictionary. This is specifically a problem when adding group objects to the group dictionary. Adding the same group object using different key names results in duplicate group names, which can send the dictnext function into an infinite loop.

NoteTo access drawing properties such as Title, Subject, Author, and Keywords, the IAcadSummaryInfo interface, accessible as a property of the Document object in the AutoCAD object model, must be used.

Return Values

The entity name of the object added to the dictionary.

Examples

The examples that follow create objects and add them to the named object dictionary.

Create a dictionary entry list:

Command: (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

((0 . "DICTIONARY") (100 . "AcDbDictionary"))

Create a dictionary object using the entmakex function:

Command: (setq xname (entmakex dictionary))

<Entity name: 1d98950>

Add the dictionary to the named object dictionary:

Command: (setq newdict (dictadd (namedobjdict) "MY_WAY_COOL_DICTIONARY" xname))

<Entity name: 1d98950>

Create an Xrecord list:

Command: (setq datalist (append (list '(0 . "XRECORD")'(100 . "AcDbXrecord")) '((1 . "This is my data") (10 1. 2. 3.) (70 . 33))))

((0 . "XRECORD") (100 . "AcDbXrecord") (1 . "This is my data") (10 1.0 2.0 3.0) (70 . 33))

Make an Xrecord object:

Command: (setq xname (entmakex datalist))

<Entity name: 1d98958>

Add the Xrecord object to the dictionary:

Command: (dictadd newdict "DATA_RECORD_1" xname)

<Entity name: 1d98958>

See Also