How to create a Revit Lookup Table parameter through Dynamo

Hello,

I am new to Dynamo and I am looking for a way to create a dropdown project parameter (like the existing ones for (e.g.) Element Phase Created, where I can select an option from a dropdown list).

So on I would not be able to set the parameter type to match a dropdown list.

I am currently trying the script below but the “Element.Setparameterbyname” its not working, as its running before the parameter creation itself.

Any ideias?

Thank you!

In order to force parts of your graph to run in a specific order you need to either connect them that way if possible or use a PassThrough or Wait node if those parts can’t otherwise be connected. You can do a quick forum search to see how they work.

1 Like

2022-02-09_15h30_01

Or you are working with “keys” in Revit 2022, they are even shared Parameters

Thank you!
I am trying to use passTrough but I cant figure it out where I should place it. It keeps giving the same error on Element.SetParameterByName, which is “No parameter found by that name”.

Is there other way to speed up the process? Like set the parameter type as a dropdownlist?

Hi @id7314 ,

If I understand correctly, you want to create something called a “Lookup Table” in Revit, which you want to create automatically via Dynamo.

I don’t think it’s possible to create these through Dynamo, but maybe I’m incorrect.

PS: I change the Topic title to “How to create a Revit Lookup Table parameter through Dynamo” from “Create dropdown parameter”, since I think this title is more fitting with the problem you are describing :slight_smile:

I’ll see if I can clarify a few things.

There’s no such thing as a “dropdown type” parameter in Revit. Unless it’s a built-in parameter with a static selection, the only way to get drop downs is to have instances of those “dropdowns” already existing in the model - either another instance of the element with that specific parameter value or another instance of that object type with that name (family type, phase, workset, etc.).

You could use Dynamo to prepopulate a number of instances with the parameter values you want in your dropdown. This isn’t the most elegant solution but it gets you started.

As @Draxl_Andreas suggested, you could also setup a key schedule and supply the parameter values as keys. This is probably the most wholistic and intelligent solution because it allows you to set actual dropdown selections based on specific key parameters. Key schedules can also be used like lookup tables since you can set multiple parameters based on a selected key. There is some limitation here depending on the version of Revit you use though.

As for your PassThrough question: a PassThrough node takes one input to eventually be “passed through” the node after another input has be supplied. In this case you want to make sure the parameter you’re creating exists before you set that parameter value. So your “wait” portion of the PassThrough node would be the output of the parameter creation. The part being passed through can be any input to the SetParameter node.

@Nick_Boyts would a transaction.end node in between also be necessary in this case? Just out of curiosity

@Daan yeah probably. Good point.