With an object ID, you can obtain a pointer to an actual database object so that you can perform operations on it. For an example, see
Opening and Closing ObjectARX Objects.
You can obtain an object ID in a number of ways:
- Create an object and append it to the database. The database then gives the object an ID and returns it to you.
- Use the database protocol for obtaining the object ID of the objects that are created automatically when a database is created (such as the fixed set of symbol tables and the named object dictionary).
- Use class-specific protocol for obtaining object IDs. Certain classes, such as symbol tables and dictionaries, define objects that own other objects. These classes provide protocol for obtaining the object IDs of the owned objects.
- Use an iterator to step through a list or set of objects. The AcDb library provides a number of iterators that can be used to step through various kinds of container objects (AcDbDictionaryIterator,
AcDbObjectIterator).
- Query a selection set. After the user has selected an object, you can ask the selection set for the list of entity names of the selected objects, and from the names convert to the object IDs. For more information on selection sets, see
Entities.