Class Hierarchy
AcAxDocLock
C++
class AcAxDocLock;
File
axlock.h
Description
This class provides document locking for custom objects that implement COM wrappers.
In order to properly append and display entities to a database from the session context, AutoCAD requires the following:
- The document for a database needs to be locked before any write operation is performed.
- The document context must be current.
AutoCAD stores graphics information on a per-document basis. The document context for the database must be current during appending new entities to the database to ensure that the graphics are updated correctly. Document activation is disabled to prevent the user from activating another document while a local COM wrapper object is in the process of appending a new entity.
AcAxDocLock constructors are responsible for performing all necessary operations and keeping track of what must be undone in the destructor. The destructor resets everything to its prior state using information cached during construction.
The AcAxDocLock class contains one enumerated type, DocLockType, which has the following possible values:
kNormal | 0 | Lock to allow write operations. |
kCurDocSwitch | 1 | Lock and switch the document context if necessary; document activation is disabled in this mode. |
Notes
In kCurDocSwitch mode, there is no document context switch if the document context for the database is already current.
The AcAxDocLock class only works properly for ObjectDBX modules when AutoCAD is the host application. AcAxDocLock methods are essentially no-ops for any other host application.
Links
AcAxDocLock Constructor, AcAxDocLock Enumerations, AcAxDocLock Methods