Get(FieldType) Method (Field, ForgeTypeId)


Retrieves the value of the field in the entity.

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

Syntax

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

Parameters

field
Type: Autodesk.Revit.DB.ExtensibleStorageField
The field to retrieve.
unitTypeId
Type: Autodesk.Revit.DBForgeTypeId
Identifier of the unit to which the value will be converted before returning. Must be compatible with the spec specified when creating the Schema.

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

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was NULL
Autodesk.Revit.ExceptionsInvalidOperationException The Field belongs to a different Schema from this Entity, or this Entity is invalid.
Autodesk.Revit.ExceptionsArgumentException Requested type does not match the field type.
Autodesk.Revit.ExceptionsArgumentException The unitTypeId value is not compatible with the field description.
Autodesk.Revit.ExceptionsArgumentException This field's subschema prevents reading.

See Also