Get(FieldType) Method (Field)


Retrieves the value of the field in the entity.

Namespace: Autodesk.Revit.DB.ExtensibleStorage
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2012

Syntax

C#
public FieldType Get<FieldType>(
	Field field
)
Visual Basic
Public Function Get(Of FieldType) ( _
	field As Field _
) As FieldType
Visual C++
public:
generic<typename FieldType>
FieldType Get(
	Field^ field
)

Parameters

field
Type: Autodesk.Revit.DB.ExtensibleStorage Field
The field to retrieve.

Type Parameters

FieldType
The type of the field

Remarks

The template parameter must match the type of the field (specified when creating the Schema) exactly; this method does not perform data type conversions. The types for containers are IList for arrays and IDictionary for maps.

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions InvalidOperationException The Field belongs to a different Schema from this Entity, or this Entity is invalid.
Autodesk.Revit.Exceptions ArgumentException Requested type does not match the field type.
Autodesk.Revit.Exceptions ArgumentException For floating-point fields, use the overload taking a ForgeTypeId parameter.
Autodesk.Revit.Exceptions ArgumentException This field's subschema prevents reading.

See Also