Share

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: 26.2.0.0 (26.2.0.0)

Syntax

C#

public class Entity : IDisposable

The Entity type exposes the following members.

Constructors

 NameDescription
Public methodEntity() The default-constructed Entity is invalid.
Public methodEntity(Entity) Constructs a new copy of the input ESEntity object.
Public methodEntity(Guid) Creates a new Entity corresponding to the Schema of the specified GUID.
Public methodEntity(Schema) Creates a new Entity corresponding to the Schema.

Properties

 NameDescription
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Public propertySchema The Schema describing this Entity.
Public propertySchemaGUID The GUID of the Schema describing this Entity.

Methods

 NameDescription
Public methodClear(Field) Resets the field to its default value.
Public methodClear(String) Resets the field to its default value.
Public methodDisposeReleases all resources used by the Entity
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGet<FieldType>(Field) Retrieves the value of the field in the entity.
Public methodGet<FieldType>(String) Retrieves the value of the field in the entity.
Public methodGet<FieldType>(Field, ForgeTypeId) Retrieves the value of the field in the entity.
Public methodGet<FieldType>(String, ForgeTypeId) Retrieves the value of the field in the entity.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsValid Checks whether this Entity has a live Schema corresponding to it.
Public methodReadAccessGranted Checks whether this Entity may be retrieved by the current add-in.
Public methodRecognizedField Checks whether a Field belongs to the same Schema as this Entity.
Public methodSet<FieldType>(Field, FieldType) Stores the value of the field in the entity.
Public methodSet<FieldType>(String, FieldType) Stores the value of the field in the entity.
Public methodSet<FieldType>(Field, FieldType, ForgeTypeId) Stores the value of the field in the entity.
Public methodSet<FieldType>(String, FieldType, ForgeTypeId) Stores the value of the field in the entity.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodWriteAccessGranted Checks whether this Entity may be stored by the current add-in.

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 null. 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

Reference

Was this information helpful?