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# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- fieldName
- Type: SystemString
The name of 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.
This method is a shortcut that will look up the field by name. If you want to call it on many entities, it is faster if you look up the field yourself.
Exceptions
Exception | Condition |
---|---|
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 name matches no field in this Entity's Schema. |
Autodesk.Revit.ExceptionsArgumentException | For floating-point fields, use the overload taking a ForgeTypeId parameter. |
Autodesk.Revit.ExceptionsArgumentException | This field's subschema prevents reading. |