AddOverride Method (ElementId, Double)


Adds an override for the given parameter as its value will be displayed for the Rebar Container element.

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

Syntax

C#
public void AddOverride(
	ElementId paramId,
	double value
)
Visual Basic
Public Sub AddOverride ( _
	paramId As ElementId, _
	value As Double _
)
Visual C++
public:
void AddOverride(
	ElementId^ paramId, 
	double value
)

Parameters

paramId
Type: Autodesk.Revit.DB ElementId
The id of the parameter
value
Type: System Double
The override value of the parameter.

Examples

Copy C#
// Override the value for A and set the parameter to modifiable for the given rebar container
void ManageParameters(RebarContainer container)
{
    RebarContainerParameterManager paramManager = container.GetParametersManager();

    Parameter aParam = container.LookupParameter("A");
    if (aParam != null)
    {
        paramManager.AddOverride(aParam.Id, 0.4);
        paramManager.SetOverriddenParameterModifiable(aParam.Id);
    }
}
Copy VB.NET
' Override the value for A and set the parameter to modifiable for the given rebar container
Private Sub ManageParameters(container As RebarContainer)
    Dim paramManager As RebarContainerParameterManager = container.GetParametersManager()

    Dim aParam As Parameter = container.LookupParameter("A")
    If aParam IsNot Nothing Then
        paramManager.AddOverride(aParam.Id, 0.4)
        paramManager.SetOverriddenParameterModifiable(aParam.Id)
    End If
End Sub

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentException paramId is not the id of a parameter in the current document, or its value type is not double. -or- paramId is not a Rebar Container parameter
Autodesk.Revit.Exceptions ArgumentNullException A non-optional argument was null
Autodesk.Revit.Exceptions DisabledDisciplineException None of the following disciplines is enabled: Structural.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →