Drawings SDK Developer Guide > Working with .dwg Files > Introduction > Basics of Database Operations and Database Objects > Database Operations
Database Operations

The database is a repository for various graphical and non-graphical objects. Programmatically, the database can be represented as a container of various objects subdivided into collections. The structure of the database includes predefined tables, which are a fixed set of collections with a fixed structure of specific objects that have fixed types and a fixed set of accessible operations.

This mechanism uses a predefined set of classes for each pair: record object – table object. The record object stores the definition and properties of one specific object. The table object stores all record objects of the same type and can be used to manipulate them. The table object can store only record objects of its own type. Each record has a specific class type, and each table also has a specific class type. The database stores the following objects as tables of records: blocks, layers, linetypes, dimension styles, text styles, user coordinate systems, registered applications, views, and viewports.

To access specific objects of tables, specific classes are used for each type of object. The list of specific objects stored as tables of records and specific classes corresponding to them is the following (object – record – table):

  • Block — OdDbBlockTableRecord — OdDbBlockTable
  • Layer — OdDbLayerTableRecord — OdDbLayerTable
  • View — OdDbViewTableRecord — OdDbViewTable
  • Linetype — OdDbLinetypeTableRecord — OdDbLinetypeTable
  • Viewport — OdDbViewportTableRecord — OdDbViewportTable
  • Text style — OdDbTextStyleTableRecord — OdDbTextStyleTable
  • Dimension style — OdDbDimStyleTableRecord — OdDbDimStyleTable
  • Registered application — OdDbRegAppTableRecord — OdDbRegAppTable
  • User coordinate system — OdDbUCSTableRecord — OdDbUCSTable

This list is fixed; you can't remove or add tables.

With the following topics you will learn how to create, read, and save a database:

Creating and Reading a Database

Saving a Database

Example of Creating and Reading Database Operations

 

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.