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