Revit 2019.1 API |
Entity..::..Get<(Of <(<'FieldType>)>)> Method (Field, DisplayUnitType) |
Entity Class See Also |
Namespace: Autodesk.Revit.DB.ExtensibleStorage
Assembly: RevitAPI (in RevitAPI.dll) Version: 19.0.0.0 (19.1.0.0)
Since:
2012
Syntax
C# |
---|
public FieldType Get<FieldType>( Field field, DisplayUnitType displayUnits ) |
Visual Basic |
---|
Public Function Get(Of FieldType) ( _ field As Field, _ displayUnits As DisplayUnitType _ ) As FieldType |
Visual C++ |
---|
public: generic<typename FieldType> FieldType Get( Field^ field, DisplayUnitType displayUnits ) |
Parameters
- field
- Type: Autodesk.Revit.DB.ExtensibleStorage..::..Field
The field to retrieve.
- displayUnits
- Type: Autodesk.Revit.DB..::..DisplayUnitType
The units to which the value will be converted before returning. Must match the UnitType specified when creating the Schema.
Type Parameters
- FieldType
Remarks
The template parameter must match the type of the field (specified when creating the Schema) exactly; no conversions will be performed inside this method (but may be performed on the returned value). The types for containers are IList for arrays and IDictionary for maps.
This method only modifies your copy of the Entity. Store the Entity in an element or another Entity to save the new value. Write access check is not performed on each call to Set. Instead, write access is checked when you try to save the Entity in an Element or another Entity.
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.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 | The displayUnits value is not compatible with the field description. |
Autodesk.Revit.Exceptions..::..ArgumentException | This field's subschema prevents reading. |