Add a parameter to the shape definition.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since: 2009
Syntax
C# |
---|
public void AddParameter( ElementId paramId, double defaultValue ) |
Visual Basic |
---|
Public Sub AddParameter ( _ paramId As ElementId, _ defaultValue As Double _ ) |
Visual C++ |
---|
public: void AddParameter( ElementId^ paramId, double defaultValue ) |
Parameters
- paramId
- Type: Autodesk.Revit.DB..::..ElementId
The parameter. To obtain the id of a shared parameter, call RebarShapeParameters.GetElementIdForExternalDefinition.
- defaultValue
- Type: System..::..Double
A default value for this parameter in shapes. The default values should be chosen carefully, because they are required to be consistent as a set of constraints.
Remarks
A shape parameter must be a shared parameter and have value type double.
A parameter must be added to the definition before it can be used to
drive the shape in a RebarShapeConstraint object.
A parameter that does not drive a constraint is legal and will
simply become an editable parameter on any Rebar that is an instance of this RebarShape.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentException | paramId is not the id of a shared parameter in the current document, or its unit type is not UT_Reinforcement_Length or UT_Angle. -or- The name of a shared parameter identified by paramId was already used by another shared parameter of the element. |
Autodesk.Revit.Exceptions..::..ArgumentNullException | A non-optional argument was NULL |
Autodesk.Revit.Exceptions..::..DisabledDisciplineException | None of the following disciplines is enabled: Structural. |