A .rfa file is a family file; a .rvt file is a model file. Each of these files
is a database that collects various graphical and non-graphical objects. These
objects have different types, sizes, destinations, functionality and specifics.
A drawing loaded from a file can contain different information about objects
that define the geometry, styles, representations, settings and attached data.
Database
A database serves as a container object for all data and relationships loaded
from the file. Objects of the database are organized in collections; each collection
contains and manipulates objects of a specific type. Each object can be accessed
using its own unique identifier, which is created by an object's database and
valid during the lifecycle of the object.
Each database contains the following types of objects:
Element — An object that usually corresponds to a single building
component such as a wall or door, but it can be also an abstract object such
as the type of something or a view. Each element has a unique ID.
Manager — A special container that stores and manages object collections.
Other objects — Objects that do not have a graphical representation,
such as groups, DBDrawings, etc.
Specifically, each database has the following main parts for storing and working
with objects:
ElemTable — Container that keeps all elements. It stores an array
of ElemRec items; each ElemRec item contains three parts of the element and element
history.
AppInfoManager — Root manager for database managers. Named managers
are used by an application, subroutines, an element's methods to find other
elements, get/set settings, and they describe element dependency, etc. Each
manager is derived from the OdBmAppInfo class and may contain additional information.
StyleSettings — Container that keeps predefined tables of predefined
built-in parameters (CategoryTable, MaterialTable, PenWidthTableGetter, LinePatternTable,
FontTable, FillPatternTable, TilePatternTable, AppearanceAssetTable, StructuralPropertySetTable).
OwnerFamilyId — ID of the main family in the file, if the database
is a family file (.rfa file).
DevBranchInfo — Container that keeps base information about the file:
product, file version, user name, language, information for work sharing,
etc.
Element
Elements are stored as an ElemTable inside the database. Each element has three
parts:
ElementHeader — Base, element-independent data, and the pointer to
the element class descriptor.
Element — Data specific to the element. For example, for CurveElement,
all data that is used for regenerating geometry and interacting with other
database objects is stored in CurveElement which is inherited from Element.
GElement — Geometry cache (or SerializedDummy if it does not have
geometry cache). GElement can contain a set of view-dependent geometries.
If it has a set of geometries, GFilter nodes should be used to choose the
correct geometry.