API Reference > OdDb Classes > OdDbObject Class
OdDbObject Class
OdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObjectOdDbObject
Syntax
C++
class OdDbObject : public OdGiDrawable;

DbObject.h

This class is the base class for all objects contained in an OdDbDatabase instance (OdDb objects).

Creating and Deleting Database Objects 

 

  • Database objects are normally created by calling OdDbXXXXX::createObject(). When an object is created, it will be in kOpenForWrite mode. The delete operator should never be called on database objects. Instead, erase() should be called, which marks the object as erased.
  • OdDbObject instances should be created by calling the createObject() method.
  • OdDbObject instances are created in kOpenForWrite mode.
  • Depending on other OdDbObject instances while constructing or deleting instances is prohibited.
  • OdDbObject instances should be deleted from an OdDbDatabase with erase().
  • Never access a pointer to a closed object.
  • The delete operator must never be called on OdDbObject instances. Instead, the erase() method should be called, which marks this object as erased.

 

Accessing Database Objects 

 

  • Database objects must be opened before they can be accessed.
  • Given a valid OdDbObjectId, a database object is opened by calling OdDbObjectId::safeOpenObject().
  • Database objects should be opened in the most restrictive mode possible, and should be released immediately when access is no longer needed.

 

Object may be opened in any one of the following modes: 

 

Mode 
Description 
OdDb::kForRead 
Allows operations that do not modify this object. 
 
A database object can be opened in this mode any number of times (simultaneously), 
 
if has not open in OdDb::kForWrite or OdDb::kForNotify mode. 
 
An exception will be thrown if any type of write operation is attempted 
 
on an object open in this mode. 
OdDb::kForWrite 
Allows read and write operations to be performed on this object. 
 
An database object can be opened in this mode only if it is not 
 
already open in any mode. 
OdDb::kForNotify 
This object is opened for notification purposes. 
 
A database object can be opened in this mode so long as it is 
 
not already open in kNotify mode. 
  • OdDbObjectId
  • OdDbDatabase

 

Corresponding C++ library: TD_Db 

 

 
Name 
Description 
 
This is ~OdDbObject, a member of class OdDbObject. 
 
Name 
Description 
 
Adds the specified persistent reactor to this object's reactor list.
 
 
Adds the specified transient reactor to this object's reactor list.
 
 
Increments the reference count of this object. 
 
This function appends this object to the specified owner object during the deep or wblock clone operation.
 
 
Notification function called each time an Undo operation is performed this object is using partial Undo.
 
 
Throws an exception if this object is not open OdDb::kForNotify. 
 
Throws an exception if this object is not open OdDb::kForRead. 
 
Throws an exception if this object is not open OdDb::kForWrite, and controls automatic undo and notification of modifications.
 
 
Perform an audit operation on this object.
 
 
After loading from file, performs necessary actions which require accessing other Database objects. For example, processing round-trip data.
 
 
The method should be called from *decomposeForSave()* of custom container objects for owned child objects. It calls child's decomposeForSave() method plus performs other required actions (handOverTo, exchanging XData, etc.)
 
 
Notification function called whenever the notifying object has had its clone() member function called.
 
 
Copies the contents of the specified object into this object when possible.
 
 
Creates an OdDbDictionary extension dictionary of this object. 
 
Creates or retrieves the specified Xrecord in this object's extension dictionary.
 
 
Returns the OdDbDatabase that contains this object. 
 
This is the overview for the decomposeForSave method overload. 
 
Performs a deep clone of this object.
 
 
Controls the undo recording of this object in OdDbDatabase.
 
 
Downgrades this object from OdDb::kForWrite to OdDb::kForRead 
 
Returns a pointer to the OdGiDrawable for the object. If the object doesn't have an associated OdGiDrawable object, this function returns NULL. 
 
Reads the .dwg file format data of this object from the specified file.
 
 
Reads the .dwg file data of this object.
 
 
Writes the .dwg file format data of this object to the specified filer.
 
 
Writes the .dwg file data of this object.
 
 
Reads the DXF format data of this object from the specified filer.
 
 
Reads the DXF data of this object.
 
 
Reads the DXF R12 format data of this object.
 
 
Writes the DXF format data of this object to the specified filer.
 
 
Writes the DXF data of this object.
 
 
Writes the DXF data of this object.
 
 
Sets the erased mode of this object.
 
 
Notification function called whenever an object has been erased or unerased.
 
 
Returns the Object ID of this object's extension dictionary. 
 
Returns the CLSID value associated with this object.
 
 
Returns the persistent handle of this database object. 
 
This is the overview for the getField method overload. 
 
This is the overview for the getFieldDictionary method overload. 
 
Returns the drawing and maintenance release version into which this object must be stored.
 
 
Returns Object IDs of this object's persistent reactors. 
 
Returns this object's transient reactors. 
 
Notification function called just before an object is deleted from memory.
 
 
Returns the OdGsCache of an OdGiDrawable object. 
 
Returns the persistent handle of this database object. 
 
Replaces this database -resident (DBRO) object with the specified non- database -resident (NDBRO) object, while retaining this object's objectId, handle, owner, and reactor list.
 
 
Returns true if and only if this object has fields. 
 
This method returns true if objId is the Object ID of a reactor attached to this object. Otherwise, it returns false.
 
 
Returns true if and only if this object has its bit set to override the filer version. 
 
id 
Returns the database ID corresponding to this object. 
 
Returns true if and only if this object is a proxy object or entity. 
 
Returns true if and only this object is a database -resident object. 
 
Returns true if and only if this object is marked as erased. 
 
Returns true if and only if this object's erased status has been toggled since it was opened. 
 
Returns true if and only if this object's assertWriteEnabled() has been called since it was opened. 
 
Returns true if and only if an object derived from OdDbEntity has been modified. 
 
Returns true if and only this object's assertWriteEnabled() and setXData() have been called since it was opened. 
 
Returns true if and only if this object has not been closed since it was created. 
 
Returns true if and only if this object is open OdDb::kForNotify. 
 
Returns true if and only if this object is sending notification. 
 
Returns true if and only if this object's Object ID is not valid because the OdDbObject::subDeepClone or OdDbObject::subWblockClone() have yet to be completed. 
 
Return true if and only if this object is database -resident (DBRO). 
 
Returns true if and only if this object is open OdDb::kForRead. 
 
Returns true if and only if a call to close would completely close this object at this time. 
 
Returns true if and only if this object is taking part in an Undo operation. 
 
Returns true if and only if this object is open OdDb::kForWrite. 
 
Returns the merge style of this object. 
 
Notification function called whenever an object is opened OdDb::kForWrite, a function has been called that could modify the contents of this object, and this object is now being closed.
 
 
Notification function called whenever an object derived from OdDbEntity is modified.
 
 
Notification function called whenever the XData has been written to the notifying object.
 
 
Notification function called whenever the notifying object is in the midst an Undo operation that is undoing modifications.
 
 
Returns the reference count of this object. 
 
Notification function called immediately before an object is closed.
 
 
Returns the Object ID of this object. 
 
This is ODDB_DECLARE_MEMBERS, a member of class OdDbObject. 
 
Notification function called whenever an object is opened for modify OdDb::kForWrite.
 
 
Returns the Object ID of this object's owner. 
 
Notification function called whenever a Redo process processes the reappending of the notifying object to the database.
 
 
Allows a subobject of a complex object to notify its root object that it has been changed.
 
 
Decrements the reference count of this object. 
 
Releases and erases this object's extension dictionary if it exists and is empty. 
 
This is the overview for the removeField method overload. 
 
Removes the specified persistent reactor from this object's reactor list.
 
 
Removes the specified transient reactor from this object's reactor list.
 
 
This is saveAsClass, a member of class OdDbObject. 
 
Adds the specified field to the field dictionary of this object.
 
 
Assigns the specified OdGsCache to the calling object.
 
 
Controls the flag specifying that this object overrides the save filer version.
 
 
Called on a new created cloned object to indicate that its Object ID is not valid. 
 
Sets this object's ownerId data member.
 
 
Sets the XData of this object.
 
 
Called as the first operation as this object is being closed, for database -resident objects only. 
 
Called as the first operation as this object is being erased or unerased.
 
 
Called as the first operation of the handOverTo function.
 
 
Notification function called whenever a method of the specified subobject has called assertWriteEnabled()
 
 
Notification function called by the Drawings framework immediately before an object is opened.
 
 
Sets the values of this object's subentity traits, and returns with the calling object's subentity traits.
 
 
Called as the first operation of swapIdWith
 
 
This is subViewportDraw, a member of class OdDbObject. 
 
This is subWorldDraw, a member of class OdDbObject. 
 
Swaps the objectIDs, handles, XData,and extension dictionary between this object and another object.
 
 
Notification function called whenever the Undo process processes the appending of the notifying object to the database.
 
 
Returns the undo filer associated with this object. 
 
Upgrades this object from OdDb::kForRead to OdDb::kForWrite. 
 
Performs a shallow clone of this object.
 
 
Returns a linked list of ResBufs containing a copy of the XData of this object.
 
 
Applies the 3D transformation matrix to the XData of this object.
 
 
Allows a subobject of a complex object to notify its root object that it has been changed. 
Copyright © 2002–2020. Open Design Alliance. All rights reserved.