API Reference > Classes > OdDAIObjectId Class > OdDAIObjectId Methods > OdDAIObjectId::openObject Method
OdDAIObjectId::openObject Method
Syntax
C++
OdDAI::ApplicationInstancePtr openObject(OdDAI::OpenMode openMode = OdDAI::kForRead, bool openErasedOne = false) const;
Parameters 
Description 
OdDAI::OpenMode openMode = OdDAI::kForRead 
[in] An open mode.  
bool openErasedOne = false 
[in] A flag that determines whether erased objects are open (equal to true) or not (equal to false).  

Returns a smart pointer to the entity instance if the object was successfull opened; otherwise, the method returns a NULL smart pionter.

Opens the database object referenced by the identifier in a specified mode.

The open mode parameter must have one of the following values:

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 notifying. 
Copyright (c) 2002-2020. Open Design Alliance. All rights reserved.