Entity Class


Entity Class

An object stored in the Extensible Storage framework. An Entity is described by a Schema, which serves both to identify an Entity, and to describe its contents (Fields).
Inheritance Hierarchy
System Object
Autodesk.Revit.DB.ExtensibleStorage Entity

Namespace: Autodesk.Revit.DB.ExtensibleStorage
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class Entity : IDisposable

The Entity type exposes the following members.

Constructors
Name Description
Public method Entity The default-constructed Entity is invalid.
Public method Entity(Entity) Constructs a new copy of the input ESEntity object.
Public method Entity(Guid) Creates a new Entity corresponding to the Schema of the specified GUID.
Public method Entity(Schema) Creates a new Entity corresponding to the Schema.
Top
Properties
Name Description
Public property IsValidObject Specifies whether the .NET object represents a valid Revit entity.
Public property Schema The Schema describing this Entity.
Public property SchemaGUID The GUID of the Schema describing this Entity.
Top
Methods
Name Description
Public method Clear(Field) Resets the field to its default value.
Public method Clear(String) Resets the field to its default value.
Public method Dispose Releases all resources used by the Entity
Public method Equals Determines whether the specified object is equal to the current object.
(Inherited from Object )
Public method Get FieldType (Field) Retrieves the value of the field in the entity.
Public method Get FieldType (String) Retrieves the value of the field in the entity.
Public method Get FieldType (Field, ForgeTypeId) Retrieves the value of the field in the entity.
Public method Get FieldType (String, ForgeTypeId) Retrieves the value of the field in the entity.
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 IsValid Checks whether this Entity has a live Schema corresponding to it.
Public method ReadAccessGranted Checks whether this Entity may be retrieved by the current add-in.
Public method RecognizedField Checks whether a Field belongs to the same Schema as this Entity.
Public method Set FieldType (Field, FieldType) Stores the value of the field in the entity.
Public method Set FieldType (String, FieldType) Stores the value of the field in the entity.
Public method Set FieldType (Field, FieldType, ForgeTypeId) Stores the value of the field in the entity.
Public method Set FieldType (String, FieldType, ForgeTypeId) Stores the value of the field in the entity.
Public method ToString Returns a string that represents the current object.
(Inherited from Object )
Public method WriteAccessGranted Checks whether this Entity may be stored by the current add-in.
Top
Remarks
An Entity is similar to an object in most object-oriented languages, while a Schema is the class of that object. The Get and Set methods are central - they provide access to the fields of the Entity. Note that an unitialized Entity retrieved from an Element or another Entity (if it has not been created yet) will be represented as an invalid entity, not . If an Element containing an Entity is split (e.g., a wall split), the Entity and its data will exist in both new Elements. If an Element containing an Entity is copied, the Element copy will also contain a copy of the Entity and its data. If an Entity stores an ElementId, and the Element with that ElementId is deleted, the stored ElementId will automatically be set to ElementId.InvalidElementId (-1).
See Also