API Reference > OdDg Classes > OdDgElementId Class > OdDgElementId Methods > OdDgElementId::openObject Method
OdDgElementId::openObject Method
Syntax
C++
OdRxObjectPtr openObject(OdDg::OpenMode openMode = OdDg::kForRead, bool openErasedOne = false) const;
Parameters 
Description 
OdDg::OpenMode openMode = OdDg::kForRead 
[in] Mode in which to open the object.  
bool openErasedOne = false 
[in] If and only if true, erased objects will be opened. 

Returns a SmartPointer to the opened object if successful, otherwise a null SmartPointer.

Opens the database object associated with this ObjectId object, in the specified mode. 

 

openMode must be one of the following: 

 

Name 
Value 
Description 
OdDg::kForRead 
Object is open for reading. 
OdDg::kForWrite 
Object is open for reading and/or writing. 
OdDg::kForNotify 
Object is open for notify. 
Copyright © 2002–2021. Open Design Alliance. All rights reserved.