Parameter.SetValue is... working?

Hello all,
I think my graph is working, but I just do not know how or why.

I obtained a list of parameters (name:value) from the sheets in my project. The list lists all revisions for each sheet. These sub-lists can vary, of course, since sheets can have different issuance history.

Also, the parameters repeat often, since there are limited revisions and many sheets with similar history.

Now, I needed to fill in these parameters with the usual “o” (the DOT to show on the sheet index), and I thought that I would have to use the usual Element.SetParameterByName, feeding it the elements (sheets) parameter names, and finally their value.

Instead, I used the Parameter.SetValue node, for some reason (I was looking at something online I think, and I found it).

Now, the Parameter.SetValue works like a charm, filling in the same string (“o”) for all the parameters in the list. The thing that drives me crazy is that I did not need to provide the list of sheets (elements) for which these parameters need to be set.

How is that possible?
Looking at my index, it appears it is working just fine…

Thank you!

Think of it almost like having a family sitting in your project browser vs the actual instances of that family in the project.
Each sheet has it’s own unique “instance” of that parameter, which is what you are retrieving and feeding to that node. So when you use Parameter.SetValue, you’re saying, “Here’s the [whatever] parameter from this sheet, set it to this value.”

Hopefully that actually made sense, haha.

1 Like

To elaborate in the context of the revit API, a parameter is an object just like the sheet is. When the parameter object is carried forwards it still has a relationship back to its original sheet.

Generally in Dynamo best practice is to set the parameters using setparameterbyname so you can carry the element forward (to what we call the downstream of the script), but your approach sounds to have worked well here as well.

1 Like

Thank you guys,

yes it is working, and it is an interesting way to set parameters’ values.

I was expecting the parameters ID node (that I used to experiment with) to return unique identifiers for each of these parameters, but they returned the same ID by parameter name.

Thank you

1 Like