ParameterSet(Double) Method |
Sets the parameter to a new real number value.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic bool Set(
double value
)
Public Function Set (
value As Double
) As Boolean
public:
bool Set(
double value
)
member Set :
value : float -> bool
Parameters
- value Double
- The new double value to which the parameter is to be set.
Return Value
BooleanThe Set method will return True if the parameter was successfully set to the new value, otherwise false.
Exceptions
RemarksYou should only use this method if the StorageType property reports the type of the
parameter as a Double.
Examplepublic bool SetParameter(Parameter parameter, double value)
{
bool result = false;
if (null != parameter && !parameter.IsReadOnly)
{
StorageType parameterType = parameter.StorageType;
if (StorageType.Double != parameterType)
{
throw new Exception("The storagetypes of value and parameter are different!");
}
result = parameter.Set(value);
}
return result;
}
Public Function SetParameter(parameter As Parameter, value As Double) As Boolean
Dim result As Boolean = False
If parameter IsNot Nothing AndAlso Not parameter.IsReadOnly Then
Dim parameterType As StorageType = parameter.StorageType
If StorageType.[Double] <> parameterType Then
Throw New Exception("The storagetypes of value and parameter are different!")
End If
result = parameter.[Set](value)
End If
Return result
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