Get the parameter value as a string with units.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Return Value
The string that represents the parameter value.Examples

String ShowValueParameterInformation(Parameter attribute)
{
string paramValue = null;
switch (attribute.StorageType)
{
case StorageType.Integer:
if (SpecTypeId.Boolean.YesNo
== attribute.Definition.GetDataType())
{
paramValue = null;
}
else
{
paramValue = attribute.AsValueString();
}
break;
case StorageType.Double:
paramValue = attribute.AsValueString();
break;
default:
paramValue = null;
break;
}
return paramValue;
}

Private Function ShowValueParameterInformation(attribute As Parameter) As [String]
Dim paramValue As String = Nothing
Select Case attribute.StorageType
Case StorageType.[Integer]
If SpecTypeId.Boolean.YesNo = attribute.Definition.GetDataType() Then
paramValue = Nothing
Else
paramValue = attribute.AsValueString()
End If
Exit Select
Case StorageType.[Double]
paramValue = attribute.AsValueString()
Exit Select
Case Else
paramValue = Nothing
Exit Select
End Select
Return paramValue
End Function