Class Hierarchy
AcHeapOperators AcRxObject AcDbDatabase
C++
class AcDbDatabase : public AcRxObject, public AcHeapOperators;
File
dbmain.h
Description
The AcDbDatabase class represents the AutoCAD drawing file. Each AcDbDatabase object contains the various header variables, symbol tables, table records, entities, and objects that make up the drawing.
The AcDbDatabase class has member functions to allow access to all the symbol tables, to read and write to DWG files, to get or set database defaults, to execute various database-level operations such as wblock and deepCloneObjects, and to get or set all header variables.
Remarks
- When a new AcDbDatabase is created (using the C++ new operator), it has Undo recording turned off. In order to enable Undo, you must call AcDbDatabase::disableUndoRecording(Adesk::kFalse). This is what AutoCAD itself does for the AcDbDatabase object used in the AutoCAD editor.
- A DWG which is created or modified as an external database (not the current DWG) and then saved using AcDbDatabase::saveAs(), loses its preview image. Examples of creating new external databases include an AcDbDatabase::wblock() of a set of entities and AcDbDatabase::readDwgFile().
AcDbDatabase::wblock( AcDbDatabase*&, const AcDbObjectIdArray&, const AcGePoint3d&);
The AcDbObjectIdArray must contain only IDs for AcDbEntities. Any other type triggers an eIllegalEntityType error. To wblockClone AcDbObjects, you must add them to the AcDbObjectIdArray only during the AcEditorReactor::beginDeepCloneXlation() callback. If a particular wblock operation is intended for only AcDbObject entities, and not AcDbEntities, it is acceptable to pass an empty AcDbObjectIdArray to wblock(), which can be filled with AcDbObjectId entities during the beginDeepCloneXlation() callback. wblock() on a set of entities to a new database and then a saveAs() on the database will not cause the preview image to appear when opening the DWG file.
Links
AcDbDatabase, AcDbDatabase Enumerations, AcDbDatabase Methods
See Also
AcDbSymbolTable, AcDbObject, AcDbEntity, AcCmColor, AcGePoint2d, AcGePoint3d, AcDbHandle, AcDbDate