Schema
The description of a single object (Entity) in the Extensible Storage framework. Contains identity information, documentation and the list of fields to be stored in the Entity.
Inheritance Hierarchy
System.Object
Autodesk.Revit.DB.ExtensibleStorage.Schema
Namespace: Autodesk.Revit.DB.ExtensibleStorage
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class Schema : IDisposable
The Schema type exposes the following members.
Properties
Name
Description
Public Property
ApplicationGUID
The GUID of the application or add-in that may access entities of this Schema under the Application access level.
Public Property
Documentation
The overall description of the Schema.
Public Property
GUID
The identifier of the Schema. Setter made unavailable, because it would violate set-correctness
Public Property
IsValidObject
Specifies whether the .NET object represents a valid Revit entity.
Public Property
ReadAccessLevel
Read access level of the schema.
Public Property
SchemaName
The user-friendly name of the Schema.
Public Property
VendorId
The id of the third-party vendor that may access entities of this Schema under the Vendor access level.
Public Property
WriteAccessLevel
Write access level of the schema.
Methods
Name
Description
Public Method
Dispose
Releases all resources used by the Schema
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object)
Public Method
GetField
Gets a Field of a given name from the Schema.
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object)
Public Method
ListFields
The complete list of fields in the Schema, sorted by name.
Public Method
Static Member
ListSchemas
Lists all schemas in memory.
Public Method
Static Member
Lookup
Finds the Schema corresponding to the GUID in memory.
Public Method
ReadAccessGranted
Checks whether Entities of this Schema may be retrieved by the current add-in.
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object)
Public Method
WriteAccessGranted
Checks whether Entities of this Schema may be stored by the current add-in.
Remarks
A Schema is similar to a class in most object-oriented languages, or to a C struct, while an Entity is an object of that class. The Schema object is immutable. To create and populate a Schema, use the SchemaBuilder class. Schemas are stored in the memory of the running instance of Revit and may be retrieved with the Lookup method. When a document containing Entities of a Schema is saved, the Schema is saved with the document too. Opening that document reintroduces the Schema into memory. As you plan to store your data in Revit, please be aware that the data will be stored in Revit elements. Overwhelming the Revit database will impact performance and stability, and will make the user unhappy. Also, remember that multiple add-ins may be storing their data simultaneously. Several kB per element or several MB per file are reasonable maximums for one add-in. If you have larger requirements, consider storing them in a separate database (such as SQLite) and storing keys into that database in Revit.