Parameter Class

The parameter object contains the value data assigned to that parameter.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBAPIObject
    Autodesk.Revit.DBParameter

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class Parameter : APIObject

The Parameter type exposes the following members.

Properties
 NameDescription
Public propertyDefinitionReturns the Definition object that describes the data type, name and other details of the parameter.
Public propertyElementThe element to which this parameter belongs.
Public propertyGUIDThe Guid for a shared parameter.
Public propertyHasValueIdentifies if the parameter has an assigned value.
Public propertyIdThe id of the parameter.
Public propertyIsReadOnlyGet the readonly property of the parameter.
(Overrides APIObjectIsReadOnly)
Public propertyIsSharedIdentifies if the parameter is a shared parameter.
Public propertyStorageTypeDescribes the type that is used internally within the parameter to store its value.
Public propertyUserModifiable Indicates whether the interactive user can modify the value of this parameter.
Top
Methods
 NameDescription
Public methodAsDoubleProvides access to the double precision number within the parameter.
Public methodAsElementIdProvides access to the Autodesk::Revit::DB::ElementId^ stored within the parameter.
Public methodAsIntegerProvides access to the integer number within the parameter.
Public methodAssociateWithGlobalParameter Associates this parameter with a global parameter in the same document.
Public methodAsStringProvides access to the string contents of the parameter.
Public methodCode exampleAsValueStringGet the parameter value as a string with units.
Public methodAsValueString(FormatOptions)Get the parameter value as a string with units.
Public methodCanBeAssociatedWithGlobalParameter Tests whether this parameter can be associated with the given global parameter.
Public methodCanBeAssociatedWithGlobalParameters Tests whether this parameter can be associated with any global parameter.
Public methodClearValueClears the parameter to its initial value.
Public methodDisposeCauses the object to release immediately any resources it may be utilizing.
(Inherited from APIObject)
Public methodDissociateFromGlobalParameter Dissociates this parameter from a global parameter.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetAssociatedGlobalParameter Returns a global parameter, if any, currently associated with this parameter.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeIdGets the identifier of the parameter.
Public methodGetUnitTypeIdGets the identifier of the unit quantifying the parameter value.
Public methodCode exampleSet(Double)Sets the parameter to a new real number value.
Public methodSet(ElementId)Sets the parameter to a new element id.
Public methodSet(Int32)Sets the parameter to a new integer value.
Public methodCode exampleSet(String)Sets the parameter to a new string of text.
Public methodStatic memberSetMultipleSets multiple parameters to new values.
Public methodCode exampleSetValueStringSet the parameter value according to the input string.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Remarks
The piece of data contained within the parameter can be either a Double, Integer, String or ElementId. The parameter object can be retrieved from any Element object using either a built in id, definition object or shared parameter guid. All Elements within Autodesk Revit contain Parameters. These are options that can be accessed in a generic fashion. Revit contains many built in parameter types but users and now developers, via the API, can add their own parameters in the form of shared parameters. The developer should become familiar with the Revit user interface for added and managing parameters and shared parameters before using this API. The user interface components can be found in the following locations: Element Properties dialog, Shared Parameters dialog (available from the File menu), Project Parameters dialog (available from the Settings menu), Family Types dialog (available from the Settings menu when editing a family). There are several relationships between the objects that make up the APIs exposure of parameters. The parameter object contains the data value. Parameter objects can be retrieved from Elements if you know its built-in id, its definition or its shared parameter guid. Each parameter has a definition. New parameters can be added to Elements by adding a ParameterBinding object to the Document object.
See Also