C++
inline Acad::ErrorStatus acdbOpenAcDbObject( AcDbObject*& pObj, AcDbObjectId id, AcDb::OpenMode mode, bool openErasedObject = false );
File
dbObject.h
Description
This function provides a means to open database-resident objects.
pObj is passed in as an empty pointer.
The mode argument may be one of the following: AcDb::kForRead, AcDb::kForWrite, or AcDb::kForNotify.
If the open attempt is successful, then pObj will be set to the address of the object and Acad::eOk will be returned.
If openErasedObject is false, then attempting to open an erased object will fail and this function will return Acad::eWasErased.
If attempting to open AcDb::kForRead and the object is already opened for read the maximum of 256 times, then the open attempt will fail and this function will return Acad::eAtMaxReaders.
If the object is currently open AcDb::kForNotify, then the open attempt will fail and this function will return Acad::eWasNotifying.
If the object is currently involved in an undo operation, then the open attempt will fail and this function will return Acad::eWasOpenForUndo.
If the object is currently open AcDb::kForWrite, then the open attempt will fail and this function will return Acad::eWasOpenForWrite.
If objId is AcDbObjectId::kNull, then the open attempt will fail and this function will return Acad::eNullObjectId.
If the document is not locked, then the open attempt will fail and this function will return Acad::eLockViolation.
Parameters
Parameters | Description |
---|---|
pObj | Input/output pointer to the opened object |
id | Input object ID of the object to open |
mode | Input mode in which to open the object |
openErasedObject | Input Boolean indicating whether to open the object if it's erased |
Previous File
dbmain.h