Vous êtes sur la page 1sur 1

One of the powers of Dynamo is that you can change or set parameter values for Revit

elements. This can be very powerful when you need to modify several parameters at once. Once
you have selected elements or family types, you can set parameter values. With element instances
selected, you can specify instance parameters. With a family type selected, you can specify type
parameters. In this exercise, all of the windows belonging to a window type have been selected in
the All Elements of Family Type node. The window type is selected in the Family Types
node. Additionally, a single window has been selected in the Select Model Element node. To set a
parameter, you need an Element.SetParameterByName node. In the node Library, expand Revit >
Elements > Element. Next, click SetParameterByName to place the node in the workspace. The
Element.SetParameterByName node has three inputs: element, parameterName, and value. You
can input a single element instance or multiple instances, and then set an instance parameter. Or,
you can input a loadable family type and set a type parameter. Take a look at each scenario. To set
an instance parameter, you can use the output of a node that has an element instance or instances
selected. Connect the Elements output of the All Elements of Family Type node to the element
input. This is actually a list of windows. Next, to specify the parameterName input, you need a String
node or a Code Block. Double-click the canvas to place a Code Block. Then enter the instance
parameter name inside of quotation marks: Sill Height. The parameter name must match the
Revit parameter exactly. After you enter the parameter name, connect the output of the Code Block
to the parameterName input. Next, place another Code Block for the parameter value. Be aware that
Dynamo uses the same units as the connected Revit project. For this example, enter 4 for 4 feet
(or 1000 for 1000 millimeters in the metric file). Remember, this is the value that you want to set the
parameter to. Lastly, connect the output of the Code Block to the value input. With the drop-down in
the Execution Bar set to Automatic, the graph will begin to process once everything is connected. It
may take a little time, since Dynamo is setting a parameter for every instance of the specified
window type. When the run is complete, you know that all the parameters have been updated in
Revit. If not, a warning will appear. The output of the Element.SetParameterByName node is actually
the elements that were input. You can view the output to see the list of windows that had a
parameter value set. Switch to Revit and select a window of the type that is selected in
Dynamo. With the window selected, look in the Properties palette to see the updated Sill Height. In
order to set an instance parameter for a single element, you can connect the Element output from
the Select Model Element node to the element input on the set parameter node. The Select Model
Element node has a single window selected. For this example, the windows Sill Height was already
updated, so change the value to 0 by updating the value in the Code Block. When the nodes are
already connected, you can enter a new value and then click in the canvas. After you do, the graph
is run with the new value. Once again, you can switch to Revit and select the window to see the
updated parameter. Finally, you can use the SetParameterByName node to set a type parameter. In
order to set a type parameter, you must input a family type. Before you do this, copy the
SetParameterByName node along with the code blocks. However, before copying nodes, it is good
practice to change the Run setting to Manual in order to avoid warnings while you are connecting
nodes. After you copy the nodes, connect the Family Type output from the Family Types node to the
element input. Then enter Window Inset for the parameter name. Next, change the value to 0.25
(or 75 in the metric file). When you Run the graph, the Window Inset of the window type will be set
to 3 inches (or 75 millimeters). Keep in mind that the SetParameterByName node is very flexible and
allows you to set instance and type parameters.

Vous aimerez peut-être aussi