API Reference > OdDb Classes > OdDbObjectId Class > OdDbObjectId Methods > OdDbObjectId::safeOpenObject Method
OdDbObjectId::safeOpenObject Method
Syntax
C++
OdDbObjectPtr safeOpenObject(OdDb::OpenMode openMode = OdDb::kForRead, bool openErasedOne = false) const;
Parameters 
Description 
OdDb::OpenMode openMode = OdDb::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.

Opens the database object associated with this ObjectId object, in the specified mode, or throws and exception if unsucessful. 

 

openMode must be one of the following: 

 

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