Can You Use List Selector to Create Inputs in Dynamo Player?

I am new to Dynamo and thought I would tackle something relatively easy as my first script. I am working on creating floor plans for project where you can define the view template, scope box, and level on which the plans are on. What I am running into an issue with is being able to select multiple levels at the same time and having that as a dynamo player input. I thought I could use list selector as an option to select the levels I wanted, but that doesn’t seem to be the case. Looking through other forums I saw there might be a solution with the Data-Shapes package, but I’m lost on how to use the
functions available if that is the route I need to go.

Create Floor Plans 2.dyn (105.5 KB)

Ok… This comes up a good bit so I’ll outline it here.

The issue with ‘selectors’ in the context of Dynamo Player’s inputs is that they need to be readible before the graph is run, as Player executes only when you hit the ‘run’ button.

And so anything which requires ‘selection’ has to be coded up in a way to do so before the graph is run.

  • Select model element / elements is done by initiating the selection mechanism before the graph is run and then modifying the selection.
  • Dropdowns are populated from model data or Revit file data in advance of execution.
  • Number and strings can have users input values before executing, with player setting the values when it is ready.
  • Sliders can be set within their range by the user with player modifying the values when ready.

All of those are actions which you can take in the Dynamo user interface without hitting run. This is a must as player can only hit run once. And so something which goes into a model and configures a list of values for the user to select one won’t work, as the that requires the user run the graph and then make a selection and run the graph again.

If you need that ‘run to configure and then allow user selection’ then the Datashapes UI++ nodes are likely the best path forward for you, as they trigger the user interface as a pop-up after execution starts, breaking the chain of execution until the user provides the selection.

There is a blog post here (and others on the same blog) which shows some node configurations for the UI nodes. Give it a try and see where you get.

1 Like

Data shapes still need some updates so instead of Data shapes nodes I used this in one of my scripts where I wanted a possibility to select from a list

Not at my computer at the moment but have a look at it. It’s not a package but you can copy the node in to your graph.

1 Like

Thank you for the help! @jacob.small @patrick.ericson

1 Like

I just stumbled over the List Selector and Dropdown List Selector nodes and was coming here to find out if there was a way to limit the selection to one item, only to be disappointed to learn that they cannot be used as Dynamo Player inputs, making my query moot. I guess I will have to go to Data-Shapes. Thanks for the information and the explanation for why they are not able to be inputs.

1 Like

One thing to note, is that if you don’t have to ‘read the data in the model’ you can make use of the “Custom Selection” tool which has been built into Dynamo since 2.16 (so any supported build from Revit 2023 and up).

This can also do cool stuff like store JSON data in the dropdown options, and they work as inputs for player as well (see example attached).


Custom Selection Dropdown in Player.dyn (100.0 KB)

ps: the geometry preview at the base is a Watch 3d node marked as an output.

1 Like

Excellent! That will work for my case. Thank you.

1 Like

Hi Jacob, I know yours is an old response, but concerning nodes that read the model content and can be used as input for Dynamo Player, there are some existing examples.

For example, “Schedule Views”, from Rhythm package, lists all Schedules in the project, and it can be set to “Input”, and it works perfectly.

So, Dynamo Player must be querying the Revit database if it is able to then display the pull-down menu with all the schedules in the model, right?

I guess my question is: how do we make other types of lists? that can be set to Input for the Dynamo Player?

Thank you

PS: ChatGTP seems able to read people most intimate desires, and then just shots out feasible solutions…. that do not exist.

Here it is claiming that a Code Block can be turned into an Input for Dynamo Player:

This can only be done using custom zero touch nodes currently.

There have been many threads wishlisting it as a node in dynamo natively but dynamo has to generally run to collect elements from the model to give to a list unless you program the population behavior as part of the node in c# on placement/loading up in dynamo player.

Most 'easy’ answers tend to point users towards data shapes, or if the list can be fixed in nature there is a new node you can add fixed outputs for added more recently to dynamo (but it cant collect dynamic things like element types in active document).

See an example from rhythm:

1 Like

Everything Gavin said is perfectly on point, so likely it answers your question. I can try to expand on anything if needed though so feel free to ask follow up questions.

The only thing he missed is yes, all the AI solutions built on large language models always hallucinate solutions. Even the ones which exist are produced this way. This works better for soft stuff than technical stuff, and for technical stuff with large collections of publicly accessible code (web development), but not for many things in AEC. The exception is tailoring the model to your use cases - stripping out the stuff that trains it which isn’t helpful and packing in extra stuff which is helpful. However developing such is a full time job and all of them need a ton of resources, so… I find them best to avoid for most use cases and google or search the forum.

1 Like

Ironically ive found that lately the AI snippets and suggestions from google tend to be more on point than CGPT, gemini I assume. Generally only for very small things (e.g. the create shared parameter definition, mostly came to me via a google AI result), but typically less hallucinations so far, likely due to the short length with less chance for it to occur.

1 Like

Yep - smaller quarries have less to transform so you get closer to the result. Also more likely there is a direct answer in the model already.

1 Like