In this guide we will take a look at how to read the parameters from a Revit element using Grasshopper.

Inspecting Parameters

Let’s bring a single element into a new Grasshopper definition. We can use the Inspect Element component to inspect the element properties.

Now hold Shift and double-click on the Inspect Element component to see a list of all parameters associated with given element

You can connect any of these properties, then Ctrl and double-click on the Inspect Element component to collapse it to normal size. The component is smart to keep the connected parameters shown in collapsed mode.

Finding the BuiltInParameter

To find a built-in parameter associated with an element parameter, pass the element and parameter name to the Find BuiltInParameter shared here.

Find BuiltInParameter
Place under Grasshopper User Objects folder. Find in Revit > Custom panel

Reading Parameter Values

A language-safe way to query the values for specific parameter is to use the Parameter Key parameter from the Revit Parameters panel

After adding this component to the canvas, you can Right-Click on the component and select the desired parameter

The output of this component can be passed to the Get Element Parameter to query the value

Another way of reading parameter values is by specifying the parameter name to the Get Element Parameter component to get the parameter value.

Since we are specifying the name of parameter in a specific language, the definition will break if opened on a Revit with a different language

When working with Shared parameters, you can also pass the parameter UUID to the component

Updating Parameters

Use the Set Element Parameter component to set a parameter value on a Revit element. The component is similar to Get Element Parameter except that is also takes a value to be applied to the parameter. Keep in mind that some parameters are Read-only and their value can not be overridden.

Notice that the Graphical Element component is only holding a reference to the Revit element. So when the parameter value is updated by the Get Element Parameter component, it is updated for all the components that is referencing that same element. This is different from what you might be used to when working with Grasshopper outside of Revit context.

Creating Shared Parameters

The components under the Parameter panel in Grasshopper, allow you to create new Shared Parameters in Revit.

Currently Revit API does not support creating project parameters

The current implementation always creates Parameters of type Text and places them under the Data category in the Revit parameters panel. The parameter will be attached to all the categories in Revit

Create a new parameter by connecting the parameter name to the Define Shared Parameter component on the canvas. You can inspect the created parameter using the Deconstruct ParameterValue component.

Here is how the parameter configuration in Shared Parameters:

The value of this parameter can later be read by passing the parameter name to the Get Element Parameter component. You can inspect the parameter value using the Deconstruct ParameterValue component.