Share

Parameter.Set(String) Method

Sets the parameter to a new string of text.


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

Syntax

C#

public bool Set(
	string value
)

Parameters

value  String
The new text value to which the parameter is to be set.

Return Value

Boolean
The Set method will return True if the parameter was successfully set to the new value, otherwise false.

Exceptions

ExceptionCondition
InvalidOperationExceptionThe parameter is read-only.

Remarks

You should only use this method if the StorageType property reports the type of the parameter as a String.

Example

C#

void AddInstanceComment(Wall wall)
{
    // Get the comment parameter of the element instance
    Parameter commentPara = wall.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS);
    if (null != commentPara)
    {
        // Add a greeting string to the comment
        commentPara.Set("Hello Everyone.");
    }
}

VB

Private Sub AddInstanceComment(wall As Wall)
    ' Get the comment parameter of the element instance
    Dim commentPara As Parameter = wall.Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)
    If commentPara IsNot Nothing Then
        ' Add a greeting string to the comment
        commentPara.[Set]("Hello Everyone.")
    End If
End Sub

See Also

Reference

Was this information helpful?