Parameter.AsValueString Method

ParameterAsValueString Method

Get the parameter value as a string with units.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public string AsValueString()
Public Function AsValueString As String
public:
String^ AsValueString()
member AsValueString : unit -> string 

Return Value

String
The string that represents the parameter value.
Example
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

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also