August 14, 2016

Dynamo - Element Parameters

If you are relatively new to Dynamo and not intimately familiar with the Revit API, like me, you may find this relatively simple graph of use.
The Select Model Element node at the upper left allows you to select an element in your Revit model and will report back, through the two Watch nodes at the right, the available instance parameters and their current values. These are the parameters that work with the Element.GetParameterValueByName and Element.SetParameterValueByName nodes. This can be helpful in identifying the parameter you need to access for a particular task.

The Element.Parameters node generates a list of these parameters, the Element.Name node takes that list and turns it into a list of the parameter names, as strings, and the List.Sort node sorts that list alphbetically. The left Watch node displays this sorted list; the list is also fed into the Element.GetParameterValueByName node, which generates a list the values for those parameters, for the selected element, and displays them in the right Watch node. My experience has been that the Element.Parameters node will list the parameters found in what seems like a random order that makes it hard (for me, anyway) to track them from element to element. The description of the Object.Identity node states that it passes out what is passed into it, doing nothing, which, I suppose, it true, but I included it here because by locking the Data Preview of the node in the open position, it shows the element category as well as the element ID number, whereas the Select Model Element node only shows the element ID number. Seeing the element category helps me be sure that I selected the desired element correctly.

Here are two screen shots of this graph in action, one with a Wall selected, and the other with a Dimension selected.
As always, you can select any of the images to see it full size.

No comments: