Revit provides a general mechanism for giving each element a set of parameters that you can edit. In the Revit UI, parameters are visible in the Element Properties dialog box. This chapter describes how to get and use built-in parameters using the Revit Platform API. For more information about user-defined shared parameters, see Shared Parameters.
In the Revit Platform API, Parameters are managed in the Element class. You can access Parameters in these ways:
- By iterating through the Element.Parameters collection of all parameters for an Element (for an example, see the sample code in Walkthrough Get Selected Element Parameters).
- By accessing the parameter directly through the overloaded Element.Parameter property. If the Parameter doesn't exist, the property returns null.
- By accessing a parameter by name via the Element.ParametersMap collection.
You can retrieve the Parameter object from an Element if you know the name string, built-in ID, definition, or GUID. The Parameter[String] property overload gets a parameter based on its localized name, so your code should handle different languages if it's going to look up parameters by name and needs to run in more than one locale.
The Parameter[GUID] property overload gets a shared parameter based on its Global Unique ID (GUID), which is assigned to the shared parameter when it's created.