ParameterType Property


Returns the user visible interpretation of the parameter data.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)

Syntax

C#
[ObsoleteAttribute("This property is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the GetDataType() method instead.")]
public abstract ParameterType ParameterType { get; }
Visual Basic
<ObsoleteAttribute("This property is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the GetDataType() method instead.")> _
Public MustOverride ReadOnly Property ParameterType As ParameterType
	Get
Visual C++
[ObsoleteAttribute(L"This property is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the GetDataType() method instead.")]
public:
virtual property ParameterType ParameterType {
	ParameterType get () abstract;
}

Remarks

The data within the parameter is stored in a very simple manner as an integer, double, string or an element id, but to the user these values may be more meaningful as Length, Volume, Mass etc. This parameter returns the interpretation that should be used for the data.

Examples

Copy C#
//Find parameter using the Parameter's definition type.
public Parameter FindParameter(Element element)
{
    Parameter foundParameter = null;
    // This will find the first parameter that measures length
    foreach (Parameter parameter in element.Parameters)
    {
        if (parameter.Definition.GetDataType() == SpecTypeId.Length)
        {
            foundParameter = parameter;
            break;
        }
    }
    return foundParameter;
}
Copy VB.NET
'Find parameter using the Parameter's definition type.
Public Function FindParameter(element As Element) As Parameter
    Dim foundParameter As Parameter = Nothing
    ' This will find the first parameter that measures length
    For Each parameter As Parameter In element.Parameters
        If parameter.Definition.GetDataType() = SpecTypeId.Length Then
            foundParameter = parameter
            Exit For
        End If
    Next
    Return foundParameter
End Function

See Also